jina.serve.runtimes.worker package#
Module contents#
- class jina.serve.runtimes.worker.WorkerRuntime(args, **kwargs)[source]#
Bases:
AsyncNewLoopRuntime
,ABC
Runtime procedure leveraging
Grpclet
for sending DataRequestsInitialize grpc and data request handling. :type args:
Namespace
:param args: args from CLI :param kwargs: keyword args- async async_setup()[source]#
Start the DataRequestHandler and wait for the GRPC and Monitoring servers to start
- 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 endpoint_discovery(empty, context)[source]#
Process the the call requested and return the list of Endpoints exposed by the Executor wrapped inside this Runtime
- Parameters
empty – The service expects an empty protobuf message
context – grpc context
- Return type
EndpointsProto
- Returns
the response request
- async process_data(requests, context)[source]#
Process the received requests 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 same request
- Parameters
request (
ControlRequest
) – the control request to processargs – additional arguments in the grpc call, ignored
- Return type
- Returns
the input request