jina.peapods.runtimes.grpc package

Module contents

class jina.peapods.runtimes.grpc.GRPCDataRuntime(args, **kwargs)[source]

Bases: jina.peapods.runtimes.base.BaseRuntime, abc.ABC

Runtime procedure leveraging Grpclet for sending DataRequests

Initialize grpc and data request handling. :type args: Namespace :param args: args from CLI :param kwargs: extra keyword arguments

run_forever()[source]

Start the Grpclet.

teardown()[source]

Close the Grpclet and DataRequestHandler.

static get_control_address(**kwargs)[source]

Does return None, exists for keeping interface compatible with ZEDRuntime

Parameters

kwargs – extra keyword arguments

Returns

None

static is_ready(ctrl_address, **kwargs)[source]

Check if status is ready.

Parameters
  • ctrl_address (str) – the address where the control message needs to be sent

  • kwargs – extra keyword arguments

Return type

bool

Returns

True if status is ready else False.

static activate(**kwargs)[source]

Does nothing :param kwargs: extra keyword arguments

static cancel(control_address, **kwargs)[source]

Cancel this runtime by sending a TERMINATE control message

Parameters
  • control_address (str) – the address where the control message needs to be sent

  • kwargs – extra keyword arguments

static wait_for_ready_or_shutdown(timeout, ctrl_address, shutdown_event, **kwargs)[source]

Check if the runtime has successfully started

Parameters
  • timeout (Optional[float]) – The time to wait before readiness or failure is determined

  • ctrl_address (str) – the address where the control message needs to be sent

  • shutdown_event (Union[Event, Event]) – the multiprocessing event to detect if the process failed

  • kwargs – extra keyword arguments

Returns

True if is ready or it needs to be shutdown