|
rad
5.1.0
|
A message requestor class. More...
Public Member Functions | |
| def | __init__ (self, *str endpoint, zmq.asyncio.Context zmq_ctx, asyncio.AbstractEventLoop loop=None, str ident_prefix='anon') |
| Create new requestor. More... | |
| def | __enter__ (self) |
| Context manager API implementation. More... | |
| def | __exit__ (self, *exc) |
| Context manager API implementation. More... | |
| bool | is_closed (self) |
| Returns true is the socket accepting requests is closed, false otherwise. More... | |
| asyncio.Future | send (self, msg) |
| Send msg to server. More... | |
| asyncio.Future | receive (self, msg) |
| Receive a reply. More... | |
| def | close (self) |
| Close the connection. More... | |
A message requestor class.
Add close or context manager support to automatically clean up Allow control of identity prefix.
| def rad.services.msg.MsgRequestor.__init__ | ( | self, | |
| *str | endpoint, | ||
| zmq.asyncio.Context | zmq_ctx, | ||
| asyncio.AbstractEventLoop | loop = None, |
||
| str | ident_prefix = 'anon' |
||
| ) |
Create new requestor.
| 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.close | ( | self | ) |
Close the connection.
| bool rad.services.msg.MsgRequestor.is_closed | ( | self | ) |
Returns true is the socket accepting requests is closed, false otherwise.
| asyncio.Future rad.services.msg.MsgRequestor.receive | ( | self, | |
| msg | |||
| ) |
Receive a reply.
@note: To abort after a timeout, use `asyncio.wait_for`.
| asyncio.Future rad.services.msg.MsgRequestor.send | ( | self, | |
| msg | |||
| ) |
Send msg to server.