zmqwrapper Package¶
zmqwrapper
Package¶
constants
Module¶
The message types that are supported by the package are -
- RAW
- PYOBJ
- JSON
- MULTIPART
- STRING
- UNICODE
This map to the same types supported by pyzmq
consumers
Module¶
-
class
zmqwrapper.consumers.
Consumer
(address, callback, message_type)[source]¶ Bases:
zmqwrapper.sockets.ClientConnection
Requestor that that can send requests of given type
- Args:
- address: the address to bind to
- callback: the callback to invoke for every reply
- message_type: the type of request to send
-
zmqwrapper.consumers.
consumer
(address, callback, message_type)[source]¶ Creates a consumer binding to the given address pull messages. The callback is invoked for every reply received.
- Args:
- address: the address to bind the PULL socket to.
- callback: the callback to invoke for every message. Must accept 1 variables - the message
- message_type: the type of message to receive
producers
Module¶
-
class
zmqwrapper.producers.
Producer
(address)[source]¶ Bases:
zmqwrapper.sockets.ServerConnection
Requestor that that can respond to requests of given type
- Args:
- address: the address to bind to
publishers
Module¶
-
class
zmqwrapper.publishers.
Publisher
(address)[source]¶ Bases:
zmqwrapper.sockets.ServerConnection
Publisher that can send messages to ZMQ
- Args:
- address: the address to bind to
repliers
Module¶
-
class
zmqwrapper.repliers.
Replier
(address, callback, message_type)[source]¶ Bases:
zmqwrapper.sockets.ServerConnection
Requestor that that can respond to requests of given type
- Args:
- address: the address to bind to
- callback: the callback to invoke for every request
- message_type: the type of reply to send
-
zmqwrapper.repliers.
replier
(address, callback, message_type)[source]¶ Creates a replier binding to the given address send replies. The callback is invoked for every request received.
- Args:
- address: the address to bind the REP socket to.
- callback: the callback to invoke for every message. Must accept 2 variables - message and the replier
- message_type: the type of message to receive
requestors
Module¶
-
class
zmqwrapper.requestors.
Requestor
(address, callback, message_type)[source]¶ Bases:
zmqwrapper.sockets.ClientConnection
Requestor that that can send requests of given type
- Args:
- address: the address to bind to
- callback: the callback to invoke for every reply
- message_type: the type of request to send
-
zmqwrapper.requestors.
requestor
(address, callback, message_type)[source]¶ Creates a requestor binding to the given address send requests. The callback is invoked for every reply received.
- Args:
- address: the address to bind the REQ socket to.
- callback: the callback to invoke for every message. Must accept 2 variables - message and the requestor
- message_type: the type of message to receive
sockets
Module¶
-
class
zmqwrapper.sockets.
ClientConnection
(address, socket_type)[source]¶ Bases:
zmqwrapper.sockets.SendReceiveMixin
,object
Creates a client side socket of given type.
- Args:
- address: the address to use
- socket_type: the tyoe of socket to open
-
class
zmqwrapper.sockets.
SendReceiveMixin
[source]¶ Provides send or receive functionality for the sockets
-
class
zmqwrapper.sockets.
ServerConnection
(address, socket_type)[source]¶ Bases:
zmqwrapper.sockets.SendReceiveMixin
,object
Creates a server side socket of given type.
- Args:
- address: the address to use
- socket_type: the tyoe of socket to open
subscribers
Module¶
-
class
zmqwrapper.subscribers.
Subscriber
(address, topics, callback, message_type)[source]¶ Bases:
zmqwrapper.sockets.ClientConnection
Subscriber that can read messages from ZMQ
- Args:
- address: the address to bind to
- topics: the topics to subscribe
- callback: the callback to invoke for every message
- message_type: the type of message to receive
-
zmqwrapper.subscribers.
subscriber
(address, topics, callback, message_type)[source]¶ Creates a subscriber binding to the given address and subscribe the given topics. The callback is invoked for every message received.
- Args:
- address: the address to bind the PUB socket to.
- topics: the topics to subscribe
- callback: the callback to invoke for every message. Must accept 2 variables - topic and message
- message_type: the type of message to receive