U
    luf                     @   s   d Z ddlmZ ddlmZ ddlmZmZmZm	Z	 G dd deZ
G dd de
eZG d	d
 d
e
e	ZG dd de
eZdd
dgZdS )z%MonitoredQueue classes and functions.    )PUB)monitored_queue)ProcessProxyProxy	ProxyBaseThreadProxyc                   @   s0   e Zd ZdZdZdZeddfddZdd Zd	S )
MonitoredQueueBasez"Base class for overriding methods.    s   ins   outc                 C   s"   t j| |||d || _|| _d S )N)in_typeout_typemon_type)r   __init__
_in_prefix_out_prefix)selfr
   r   r   Z	in_prefixZ
out_prefix r   D/tmp/pip-unpacked-wheel-h6ekxre8/zmq/devices/monitoredqueuedevice.pyr      s    zMonitoredQueueBase.__init__c                 C   s&   |   \}}}t|||| j| j d S )N)Z_setup_socketsr   r   r   )r   ZinsZoutsZmonsr   r   r   
run_device   s    zMonitoredQueueBase.run_deviceN)	__name__
__module____qualname____doc__r   r   r   r   r   r   r   r   r   r      s     
r   c                   @   s   e Zd ZdZdS )MonitoredQueueaU  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.
    Nr   r   r   r   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZdS )ThreadMonitoredQueuezcRun zmq.monitored_queue in a background thread.

    See MonitoredQueue and Proxy for details.
    Nr   r   r   r   r   r   /   s   r   c                   @   s   e Zd ZdZdS )ProcessMonitoredQueuezbRun zmq.monitored_queue in a separate process.

    See MonitoredQueue and Proxy for details.
    Nr   r   r   r   r   r   6   s   r   N)r   Zzmqr   Zzmq.devices.monitoredqueuer   Zzmq.devices.proxydevicer   r   r   r   r   r   r   r   __all__r   r   r   r   <module>   s   