summaryrefslogtreecommitdiff
path: root/zmq/devices/monitoredqueuedevice.py
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2014-11-11 11:52:45 -0500
committerMicah Anderson <micah@riseup.net>2014-11-11 11:52:45 -0500
commit44be832c5708baadd146cb954befbc3dcad8d463 (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /zmq/devices/monitoredqueuedevice.py
parent76755110103988258ec37afbb4c022f7ac3ddf54 (diff)
prepare for upgrade to new upstream
Diffstat (limited to 'zmq/devices/monitoredqueuedevice.py')
-rw-r--r--zmq/devices/monitoredqueuedevice.py66
1 files changed, 0 insertions, 66 deletions
diff --git a/zmq/devices/monitoredqueuedevice.py b/zmq/devices/monitoredqueuedevice.py
deleted file mode 100644
index 9723f86..0000000
--- a/zmq/devices/monitoredqueuedevice.py
+++ /dev/null
@@ -1,66 +0,0 @@
-"""MonitoredQueue classes and functions."""
-
-# Copyright (C) PyZMQ Developers
-# Distributed under the terms of the Modified BSD License.
-
-
-from zmq import ZMQError, PUB
-from zmq.devices.proxydevice import ProxyBase, Proxy, ThreadProxy, ProcessProxy
-from zmq.devices.monitoredqueue import monitored_queue
-
-
-class MonitoredQueueBase(ProxyBase):
- """Base class for overriding methods."""
-
- _in_prefix = b''
- _out_prefix = b''
-
- def __init__(self, in_type, out_type, mon_type=PUB, in_prefix=b'in', out_prefix=b'out'):
-
- ProxyBase.__init__(self, in_type=in_type, out_type=out_type, mon_type=mon_type)
-
- self._in_prefix = in_prefix
- self._out_prefix = out_prefix
-
- def run_device(self):
- ins,outs,mons = self._setup_sockets()
- monitored_queue(ins, outs, mons, self._in_prefix, self._out_prefix)
-
-
-class MonitoredQueue(MonitoredQueueBase, Proxy):
- """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.
- """
- pass
-
-
-class ThreadMonitoredQueue(MonitoredQueueBase, ThreadProxy):
- """Run zmq.monitored_queue in a background thread.
-
- See MonitoredQueue and Proxy for details.
- """
- pass
-
-
-class ProcessMonitoredQueue(MonitoredQueueBase, ProcessProxy):
- """Run zmq.monitored_queue in a background thread.
-
- See MonitoredQueue and Proxy for details.
- """
-
-
-__all__ = [
- 'MonitoredQueue',
- 'ThreadMonitoredQueue',
- 'ProcessMonitoredQueue'
-]