Start a zeromq device.
Deprecated since version libzmq-3.2: Use zmq.proxy
Parameters: |
|
---|
Start a zeromq proxy (replacement for device).
New in version libzmq-3.2.
New in version 13.0.
Parameters: |
|
---|
0MQ Device classes for running in background threads or processes.
A 0MQ Device to be run in the background.
You do not pass Socket instances to this, but rather Socket types:
Device(device_type, in_socket_type, out_socket_type)
For instance:
dev = Device(zmq.QUEUE, zmq.DEALER, zmq.ROUTER)
Similar to zmq.device, but socket types instead of sockets themselves are passed, and the sockets are created in the work thread, to avoid issues with thread safety. As a result, additional bind_{in|out} and connect_{in|out} methods and setsockopt_{in|out} allow users to specify connections for the sockets.
Parameters: |
---|
passthrough for {in|out}_socket.bind(iface), to be called in the thread
passthrough for {in|out}_socket.connect(iface), to be called in the thread
passthrough for {in|out}_socket.setsockopt(opt, value), to be called in the thread
int – sets whether the thread should be run as a daemon Default is true, because if it is false, the thread will not exit unless it is killed
callable (class attribute) – Function for creating the Context. This will be Context.instance in ThreadDevices, and Context in ProcessDevices. The only reason it is not instance() in ProcessDevices is that there may be a stale Context instance already initialized, and the forked environment should never try to use it.
Enqueue ZMQ address for binding on in_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 out_socket.
See zmq.Socket.connect for details.
wait for me to finish, like Thread.join.
Reimplemented appropriately by subclasses.
Enqueue setsockopt(opt, value) for in_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.
A Device that will be run in a background Thread.
See Device for details.
A Device that will be run in a background Process.
See Device for details.
Callable that returns a context. Typically either Context.instance or Context, depending on whether the device should share the global instance or not.
alias of Context
Threadsafe Proxy object.
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 Proxy is a 3-socket ZMQ Device that functions just like a QUEUE, except each message is also sent out on the monitor socket.
A PUB socket is the most logical choice for the mon_socket, but it is not required.
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.
Proxy in a Thread. See Proxy for more.
Proxy in a Process. See Proxy for more.
Start a monitored queue device.
A monitored queue is very similar to the zmq.proxy device (monitored queue came first).
Differences from zmq.proxy:
Parameters: |
|
---|
Class for running monitored_queue in the background.
See zmq.devices.Device for most of the spec. MonitoredQueue differs from Proxy, only in that it adds a prefix to messages sent on the monitor socket, with a different prefix for each direction.
MQ also supports ROUTER on both sides, which zmq.proxy does not.
If a message arrives on in_sock, it will be prefixed with in_prefix on the monitor socket. If it arrives on out_sock, it will be prefixed with out_prefix.
A PUB socket is the most logical choice for the mon_socket, but it is not required.
Run zmq.monitored_queue in a background thread.
See MonitoredQueue and Proxy for details.
Run zmq.monitored_queue in a background thread.
See MonitoredQueue and Proxy for details.