sender
– Sender¶
The sender is responsible for sending messages
-
class
eventmq.sender.
Sender
(*args, **kwargs)¶ Sends messages to a particular socket
-
name
¶ str – Name of this socket
-
zcontext
¶ zmq.Context
– socket context
-
zsocket
¶
-
__init__
(*args, **kwargs)¶ Note
All args are optional unless otherwise noted.
Parameters: - name (str) – name of this socket. By default a uuid will be generated
- context (
zmq.Context
) – Context to use when building the socket - socket (
zmq.Socket
) – Should be one ofzmq.REQ
orzmq.DEALER
. By default a DEALER is used - skip_zmqstream (bool) – If set to true, skip creating the zmqstream socket
-
connect
(addr=None)¶ Connect to address defined by addr
Parameters: addr (str) – Address to connect to as a connection string Raises: Exception
-
listen
(addr=None)¶ start listening on addr
Parameters: addr (str) – Address to listen on as a connction string Raises: Exception
-
ready
¶ Property used to check if this receiver is ready.
Returns: - True if the receiver is ready to connect or listen, otherwise
- False
Return type: bool
-
rebuild
(*args, **kwargs)¶ Rebuilds the socket. This is useful when you need to reconnect to something without restarting the process. Many of these things happen happen during
self.__init__()
, so it takes roughly the same parameters asself.__init__()
Parameters: - socket (
zmq.Socket
) – Should be one ofzmq.REQ
orzmq.DEALER
. By default a DEALER is used - skip_zmqstream (bool) – If set to true, skip creating the zmqstream socket
- socket (
-