rad  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
rad.services.msg.MsgRequestor Class Reference

A message requestor class. More...

Public Member Functions

def __init__
 Create new requestor. More...
 
def __enter__
 Context manager API implementation. More...
 
def __exit__
 Context manager API implementation. More...
 
def is_closed
 Returns true is the socket accepting requests is closed, false otherwise. More...
 
def send
 Send msg to server. More...
 
def receive
 Receive a reply. More...
 
def close
 Close the connection. More...
 
def __init__
 Create new requestor. More...
 
def __enter__
 Context manager API implementation. More...
 
def __exit__
 Context manager API implementation. More...
 
def is_closed
 Returns true is the socket accepting requests is closed, false otherwise. More...
 
def send
 Send msg to server. More...
 
def receive
 Receive a reply. More...
 
def close
 Close the connection. More...
 

Detailed Description

A message requestor class.

Note
: The MsgRequestor may also be used as a context manager to automatically close the connection.
Add close or context manager support to automatically clean up
Allow control of identity prefix.

Constructor & Destructor Documentation

def rad.services.msg.MsgRequestor.__init__ (   self,
  endpoint 
)

Create new requestor.

Params
endpoint ZMQ endpoint to connect to. zmq_ctx The ZMQ Context to use. loop The asyncio event loop to use. Default is to use the current event loop. ident_prefix Optional identity prefix.
def rad.services.msg.MsgRequestor.__init__ (   self,
  endpoint 
)

Create new requestor.

Params
endpoint ZMQ endpoint to connect to. zmq_ctx The ZMQ Context to use. loop The asyncio event loop to use. Default is to use the current event loop. ident_prefix Optional identity prefix.

Member Function Documentation

def rad.services.msg.MsgRequestor.__enter__ (   self)

Context manager API implementation.

def rad.services.msg.MsgRequestor.__enter__ (   self)

Context manager API implementation.

def rad.services.msg.MsgRequestor.__exit__ (   self,
  exc 
)

Context manager API implementation.

def rad.services.msg.MsgRequestor.__exit__ (   self,
  exc 
)

Context manager API implementation.

def rad.services.msg.MsgRequestor.close (   self)

Close the connection.

def rad.services.msg.MsgRequestor.close (   self)

Close the connection.

def rad.services.msg.MsgRequestor.is_closed (   self,
  bool 
)

Returns true is the socket accepting requests is closed, false otherwise.

def rad.services.msg.MsgRequestor.is_closed (   self,
  bool 
)

Returns true is the socket accepting requests is closed, false otherwise.

def rad.services.msg.MsgRequestor.receive (   self,
  msg,
  asyncio,
  Future 
)

Receive a reply.

   @note: To abort after a timeout, use `asyncio.wait_for`.
Params
msg Protobuf message instance or type, used to fill/deserialize incoming message.
Returns
Future that resolves to the parsed message.
def rad.services.msg.MsgRequestor.receive (   self,
  msg,
  asyncio,
  Future 
)

Receive a reply.

   @note: To abort after a timeout, use `asyncio.wait_for`.
Params
msg Protobuf message instance or type, used to fill/deserialize incoming message.
Returns
Future that resolves to the parsed message.
def rad.services.msg.MsgRequestor.send (   self,
  msg,
  asyncio,
  Future 
)

Send msg to server.

Params
msg Protobuf message.
Returns
Future that resolves when sending is complete.
def rad.services.msg.MsgRequestor.send (   self,
  msg,
  asyncio,
  Future 
)

Send msg to server.

Params
msg Protobuf message.
Returns
Future that resolves when sending is complete.

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