jina.serve.runtimes.head package#
Module contents#
- class jina.serve.runtimes.head.HeadRuntime(args, **kwargs)[source]#
Bases:
AsyncNewLoopRuntime
,ABC
Runtime is used in head pods. It responds to Gateway requests and sends to uses_before/uses_after and its workers
Initialize grpc server for the head runtime. :type args:
Namespace
:param args: args from CLI :param kwargs: keyword args- DEFAULT_POLLING = 1#
- async process_single_data(request, context)[source]#
Process the received requests and return the result as a new request
- Parameters
request (
DataRequest
) – the data request to processcontext – grpc context
- Return type
- Returns
the response request
- async process_data(requests, context)[source]#
Process the received data request and return the result as a new request
- Parameters
requests (
List
[DataRequest
]) – the data requests to processcontext – grpc context
- Return type
- Returns
the response request
- async process_control(request, *args)[source]#
Process the received control request and return the input request
- Parameters
request (
ControlRequest
) – the data request to processargs – additional arguments in the grpc call, ignored
- Return type
- Returns
the input request