jina.peapods.runtimes.jinad package

Module contents

class jina.peapods.runtimes.jinad.JinadRuntime(args, **kwargs)[source]

Bases: jina.peapods.runtimes.zmq.asyncio.AsyncNewLoopRuntime

Runtime procedure for JinaD.

async async_setup()[source]

Create Workspace, Pea on remote JinaD server

async async_run_forever()[source]

Streams log messages using websocket from remote server

async async_cancel()[source]

Cancels the logstream task, removes the remote Pea

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

Signal the runtime to terminate

Parameters
  • cancel_event (Union[ForwardRef, ForwardRef]) – the cancel event to set

  • kwargs – extra keyword arguments

static activate(control_address, timeout_ctrl, socket_in_type, logger, **kwargs)[source]

Check if the runtime has successfully started

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

  • timeout_ctrl (int) – the timeout to wait for control messages to be processed

  • socket_in_type (SocketType) – the type of input socket, needed to know if is a dealer

  • logger (JinaLogger) – the JinaLogger to log messages

  • kwargs – extra keyword arguments

static get_control_address(host, port, **kwargs)[source]

Get the control address for a runtime with a given host and port

Parameters
  • host (str) – the host where the runtime works

  • port (str) – the control port where the runtime listens

  • kwargs – extra keyword arguments

Returns

The corresponding control address