File: //lib64/python3.6/site-packages/zmq/sugar/__pycache__/tracker.cpython-36.pyc
3
VS�_� � @ s| d Z ddlZyddlmZ W n$ eefk
r@ ddlmZ Y nX ddlmZ ddl m
Z
G dd� de�Ze� Z
dd gZdS )
z(Tracker for zero-copy messages with 0MQ.� N)�_Event)�Event)�NotDone)�Framec @ s6 e Zd ZdZdZdZdd� Zedd� �Zddd �Z dS )�MessageTrackera� MessageTracker(*towatch)
A class for tracking if 0MQ is done using one or more messages.
When you send a 0MQ message, it is not sent immediately. The 0MQ IO thread
sends the message at some later time. Often you want to know when 0MQ has
actually sent the message though. This is complicated by the fact that
a single 0MQ message can be sent multiple times using different sockets.
This class allows you to track all of the 0MQ usages of a message.
Parameters
----------
towatch : Event, MessageTracker, Message instances.
This objects to track. This class can track the low-level
Events used by the Message class, other MessageTrackers or
actual Messages.
Nc G s� t � | _t � | _xt|D ]l}t|t�r2| jj|� qt|t�rJ| jj|� qt|t�rr|jsbt d��| jj|j� qt
dt|� ��qW dS )a~ MessageTracker(*towatch)
Create a message tracker to track a set of mesages.
Parameters
----------
*towatch : tuple of Event, MessageTracker, Message instances.
This list of objects to track. This class can track the low-level
Events used by the Message class, other MessageTrackers or
actual Messages.
zNot a tracked messagez(Require Events or Message Frames, not %sN)�set�events�peers�
isinstancer �addr r Ztracker�
ValueError� TypeError�type)�selfZtowatch�obj� r �/usr/lib64/python3.6/tracker.py�__init__'