%PDF- %PDF-
Mini Shell

Mini Shell

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

�
+�{Wc@�s�dZddlmZmZmZddlZddlZddlZddlm	Z	m
Z
mZmZm
Z
mZyddlZejZWneefk
r�dZnXy*ddlmZmZddlmZWn7ek
rddlmZmZddlmZnXdefd	��YZd
efd��YZdefd
��YZdekojdknr�ed�Z e e_!neZ"d�Z#dS(sXtornado IOLoop API with zmq compatibility

If you have tornado ≥ 3.0, this is a subclass of tornado's IOLoop,
otherwise we ship a minimal subset of tornado in zmq.eventloop.minitornado.

The minimal shipped version of tornado's IOLoop does not include
support for concurrent futures - this will only be available if you
have tornado ≥ 3.0.
i(tabsolute_importtdivisiontwith_statementN(tPollertPOLLINtPOLLOUTtPOLLERRtZMQErrortETERM(t
PollIOLooptPeriodicCallback(tgen_logitDelayedCallbackcB�s,eZdZdd�Zd�Zd�ZRS(s�Schedules the given callback to be called once.

    The callback is called once, after callback_time milliseconds.

    `start` must be called after the DelayedCallback is created.
    
    The timeout is calculated from when `start` is called.
    cC�s?tjdt�t|d�}tt|�j|||�dS(NsDDelayedCallback is deprecated.
        Use loop.add_timeout instead.g����MbP?(twarningstwarntDeprecationWarningtmaxtsuperRt__init__(tselftcallbackt
callback_timetio_loop((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyR3s
cC�sIt|_t|_tj�|jd|_|jj|j|j�dS(sStarts the timer.g@�@N(	tTruet_runningt	_firstrunttimeRt
_next_timeoutRtadd_timeoutt_run(R((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pytstart:s		cC�sO|js
dSt|_y|j�Wn$tk
rJtjddt�nXdS(NsError in delayed callbacktexc_info(RtFalseRt	ExceptionRterrorR(R((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyRAs		
N(t__name__t
__module__t__doc__tNoneRRR(((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyR*s	t	ZMQPollercB�sbeZdZd�Zed��Zed��Zd�Zd�Zd�Z	d�Z
d�ZRS(	s�A poller that can be used in the tornado IOLoop.
    
    This simply wraps a regular zmq.Poller, scaling the timeout
    by 1000, so that it is in seconds rather than milliseconds.
    cC�st�|_dS(N(Rt_poller(R((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyRQscC�sXd}|tj@r |tO}n|tj@r:|tO}n|tj@rT|tO}n|S(sEtranslate IOLoop.READ/WRITE/ERROR event masks into zmq.POLLIN/OUT/ERRi(tIOLooptREADRtWRITERtERRORR(teventstz_events((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyt_map_eventsTs





cC�sXd}|t@r |tjO}n|t@r:|tjO}n|t@rT|tjO}n|S(sEtranslate zmq.POLLIN/OUT/ERR event masks into IOLoop.READ/WRITE/ERRORi(RR)R*RR+RR,(R.R-((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyt
_remap_events`s


cC�s|jj||j|��S(N(R(tregisterR/(RtfdR-((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyR1lscC�s|jj||j|��S(N(R(tmodifyR/(RR2R-((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyR3oscC�s|jj|�S(N(R(t
unregister(RR2((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyR4rscC�sB|jjd|�}g|D]!\}}||j|�f^qS(sopoll in seconds rather than milliseconds.
        
        Event masks will be IOLoop.READ/WRITE/ERROR
        i�(R(tpollR0(RttimeoutR.R2tevt((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyR5uscC�sdS(N((R((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pytclose}s(R#R$R%RtstaticmethodR/R0R1R3R4R5R8(((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyR'Js					t	ZMQIOLoopcB�sAeZdZdd�Zed��Zed��Zd�ZRS(s ZMQ subclass of tornado's IOLoopcK�s;|dkrt�n|}tt|�jd||�dS(Ntimpl(R&R'RR:t
initialize(RR;tkwargs((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyR<�scO�s,tdkrtjt�ntj||�S(s
Returns a global `IOLoop` instance.
        
        Most applications have a single, global `IOLoop` running on the
        main thread.  Use this method to get this instance from
        another thread.  To get the current thread's `IOLoop`, use `current()`.
        i(i(ttornado_versionR	t	configureR:tinstance(targsR=((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyR@�s
cO�s,tdkrtjt�ntj||�S(s/Returns the current thread’s IOLoop.
        i(i(R>R	R?R:tcurrent(RAR=((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyRB�scC�sIytt|�j�Wn+tk
rD}|jtkr;qE|�nXdS(N(RR:RRterrnoR(Rte((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyR�sN(	R#R$R%R&R<R9R@RBR(((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyR:�s

icC�s&ddlm}|jj|�|�S(sBbackport IOLoop.close to 3.0 from 3.1 (supports fd.close() method)i(R	(t zmq.eventloop.minitornado.ioloopR	R8t__get__(Rtall_fdst	mini_loop((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pytbackport_close�scC�s|ddlm}|jj�sG|jj�tj�ksGtd��tdkrf|jjt�ntj�|j_	dS(s4set the tornado IOLoop instance with the pyzmq IOLoop.
    
    After calling this function, tornado's IOLoop.instance() and pyzmq's
    IOLoop.instance() will return the same object.
    
    An assertion error will be raised if tornado's IOLoop has been initialized
    prior to calling this function.
    i(tioloops"tornado IOLoop already initializediN(i(
ttornadoRJR)tinitializedR@tAssertionErrorR>R?R:t	_instance(RJ((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pytinstall�s	'((ii(ii($R%t
__future__RRRtosRR
tzmqRRRRRRRKtversion_infoR>tImportErrortAttributeErrorttornado.ioloopR	R
ttornado.logRtminitornado.iolooptminitornado.logRtobjectR'R:R RIR8R)RO(((s:/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.pyt<module>
s0.


 7*

Zerion Mini Shell 1.0