MonitoredQueue classes and functions.
Threadsafe MonitoredQueue object.
Warning as with most ‘threadsafe’ Python objects, this is only threadsafe as long as you do not use private methods or attributes. Private names are prefixed with ‘_’, such as ‘self._setup_socket()’.
See zmq.devices.Device for most of the spec. This subclass adds a <method>_mon version of each <method>_{in|out} method, for configuring the monitor socket.
A MonitoredQueue is a 3-socket ZMQ Device that functions just like a QUEUE, except each message is also sent out on the monitor socket.
If a message comes from in_sock, it will be prefixed with ‘in’. If it comes from out_sock, it will be prefixed with ‘out’
A PUB socket is perhaps the most logical for the mon_socket, but it is not restricted.
Enqueue ZMQ address for binding on in_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for binding on mon_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for binding on out_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for connecting on in_socket.
See zmq.Socket.connect for details.
Enqueue ZMQ address for connecting on mon_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for connecting on out_socket.
See zmq.Socket.connect for details.
Returns a global Context instance.
Most single-threaded applications have a single, global Context. Use this method instead of passing around Context instances throughout your code.
A common pattern for classes that depend on Contexts is to use a default argument to enable programs with multiple Contexts but not require the argument for simpler applications:
- class MyClass(object):
- def __init__(self, context=None):
- self.context = context or Context.instance()
wait for me to finish, like Thread.join.
Reimplemented appropriately by sublcasses.
Enqueue setsockopt(opt, value) for in_socket
See zmq.Socket.setsockopt for details.
Enqueue setsockopt(opt, value) for mon_socket
See zmq.Socket.setsockopt for details.
Enqueue setsockopt(opt, value) for out_socket
See zmq.Socket.setsockopt for details.
Start the device. Override me in subclass for other launchers.
Base class for overriding methods.
Enqueue ZMQ address for binding on mon_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for connecting on mon_socket.
See zmq.Socket.bind for details.
Enqueue setsockopt(opt, value) for mon_socket
See zmq.Socket.setsockopt for details.
MonitoredQueue in a Process. See MonitoredQueue for more.
Enqueue ZMQ address for binding on in_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for binding on mon_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for binding on out_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for connecting on in_socket.
See zmq.Socket.connect for details.
Enqueue ZMQ address for connecting on mon_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for connecting on out_socket.
See zmq.Socket.connect for details.
alias of Context
Enqueue setsockopt(opt, value) for in_socket
See zmq.Socket.setsockopt for details.
Enqueue setsockopt(opt, value) for mon_socket
See zmq.Socket.setsockopt for details.
Enqueue setsockopt(opt, value) for out_socket
See zmq.Socket.setsockopt for details.
MonitoredQueue in a Thread. See MonitoredQueue for more.
Enqueue ZMQ address for binding on in_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for binding on mon_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for binding on out_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for connecting on in_socket.
See zmq.Socket.connect for details.
Enqueue ZMQ address for connecting on mon_socket.
See zmq.Socket.bind for details.
Enqueue ZMQ address for connecting on out_socket.
See zmq.Socket.connect for details.
Returns a global Context instance.
Most single-threaded applications have a single, global Context. Use this method instead of passing around Context instances throughout your code.
A common pattern for classes that depend on Contexts is to use a default argument to enable programs with multiple Contexts but not require the argument for simpler applications:
- class MyClass(object):
- def __init__(self, context=None):
- self.context = context or Context.instance()
Enqueue setsockopt(opt, value) for in_socket
See zmq.Socket.setsockopt for details.
Enqueue setsockopt(opt, value) for mon_socket
See zmq.Socket.setsockopt for details.
Enqueue setsockopt(opt, value) for out_socket
See zmq.Socket.setsockopt for details.