proxystore.stream.shims.zmq¶
ZeroMQ pub/sub interface.
Note
Unlike some of the other shims that simply interface with a third-party message broker system, here the subscriber connects directly to the publisher. This means that if the publisher is not alive when creating the subscriber, the subscriber will fail.
ZeroMQPublisher
¶
ZeroMQ publisher interface.
Parameters:
-
address
(str
) –Address to bind to. The full address bound to will be
'tcp://{address}:{port}'
. -
port
(int
) –Port to bind to.
Source code in proxystore/stream/shims/zmq.py
ZeroMQSubscriber
¶
ZeroMQ subscriber interface.
This subscriber is an iterable object which yields bytes
messages indefinitely from the stream while connected to a publisher.
Parameters:
-
address
(str
) –Publisher address to connect to. The full address will be constructed as
'tcp://{address}:{port}'
. -
port
(int
) –Publisher port to connect to.
-
topic
(str
, default:''
) –Topic to subscribe to. The default
''
subscribes to all topics.