rad  5.1.0
Public Member Functions | List of all members
rad.services.msg.MsgReplier Class Reference

A protobuf-aware message replier. More...

Public Member Functions

def __init__ (self, *str endpoint, list msg_types, handler, zmq.asyncio.Context zmq_ctx, asyncio.AbstractEventLoop loop, unknown_msg_handler=None)
 
bool is_closed (self)
 
def start (self)
 Starts accepting incoming requests. More...
 
def send (self, bytes identity, msg)
 Send protobuf msg to identity. More...
 
def stop (self)
 Unbinds socket and shuts down all related tasks to this Replier. More...
 

Detailed Description

A protobuf-aware message replier.

Constructor & Destructor Documentation

◆ __init__()

def rad.services.msg.MsgReplier.__init__ (   self,
*str  endpoint,
list  msg_types,
  handler,
zmq.asyncio.Context  zmq_ctx,
asyncio.AbstractEventLoop  loop,
  unknown_msg_handler = None 
)
Params
endpoint ZMQ endpoint to bind to. msg_types List of protobuf message types (pb_msg, pb_msg, ...). loop The asyncio event loop to use. unknown_msg_handler Handler of unknown message types. It must be a callable with the signature handler(identity, msg_name, msg).

Member Function Documentation

◆ is_closed()

bool rad.services.msg.MsgReplier.is_closed (   self)
Returns
true if it is not possible to receive requests, false otherwise.

◆ send()

def rad.services.msg.MsgReplier.send (   self,
bytes  identity,
  msg 
)

Send protobuf msg to identity.

Returns
Future that resolves when message been sent.

◆ start()

def rad.services.msg.MsgReplier.start (   self)

Starts accepting incoming requests.

◆ stop()

def rad.services.msg.MsgReplier.stop (   self)

Unbinds socket and shuts down all related tasks to this Replier.

The ZmqMsgReplier is essentially dead after this.

see rad.services.msg.ZmqMsgReplier.stop.


The documentation for this class was generated from the following file: