%PDF- %PDF-
Mini Shell

Mini Shell

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

�
��L]c@�sdZddlmZmZmZmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlmZmZddlmZmZddlmZddlmZmZmZyddl Z Wne!k
rQe"Z nXyddl#Z#Wne!k
r�ddl$Z#nXddl%m&Z&m'Z'd	Z(d
e)fd��YZ*defd
��YZ+de+fd��YZ,de-fd��YZ.de-fd��YZ/dS(s�An I/O event loop for non-blocking sockets.

Typical applications will use a single `IOLoop` object, in the
`IOLoop.instance` singleton.  The `IOLoop.start` method should usually
be called at the end of the ``main()`` function.  Atypical applications may
use more than one `IOLoop`, such as one `IOLoop` per thread, or per `unittest`
case.

In addition to I/O events, the `IOLoop` can also schedule time-based events.
`IOLoop.add_timeout` is a non-blocking alternative to `time.sleep`.
i(tabsolute_importtdivisiontprint_functiontwith_statementN(tTracebackFuturet	is_future(tapp_logtgen_log(t
stack_context(tConfigurableterrno_from_exceptionttimedelta_to_seconds(tset_close_exectWakerg �@tTimeoutErrorcB�seZRS((t__name__t
__module__(((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRBstIOLoopcB�s�eZdZdZdZdZdZdZdZd,Z	d-Z
d	ZeZeZ
eeBZej�Zej�Zed
��Zed��Zd�Zed
��Zeed��Zd�Zed��Zed��Zed��Zd.d�Z!e"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*d�Z+d�Z,d.d�Z-d�Z.d �Z/d!�Z0d"�Z1d#�Z2d$�Z3d%�Z4d&�Z5d'�Z6d(�Z7d)�Z8d*�Z9d+�Z:RS(/s�A level-triggered I/O loop.

    We use ``epoll`` (Linux) or ``kqueue`` (BSD and Mac OS X) if they
    are available, or else we fall back on select(). If you are
    implementing a system that needs to handle thousands of
    simultaneous connections, you should use a system that supports
    either ``epoll`` or ``kqueue``.

    Example usage for a simple TCP server:

    .. testcode::

        import errno
        import functools
        import tornado.ioloop
        import socket

        def connection_ready(sock, fd, events):
            while True:
                try:
                    connection, address = sock.accept()
                except socket.error as e:
                    if e.args[0] not in (errno.EWOULDBLOCK, errno.EAGAIN):
                        raise
                    return
                connection.setblocking(0)
                handle_connection(connection, address)

        if __name__ == '__main__':
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
            sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
            sock.setblocking(0)
            sock.bind(("", port))
            sock.listen(128)

            io_loop = tornado.ioloop.IOLoop.current()
            callback = functools.partial(connection_ready, sock)
            io_loop.add_handler(sock.fileno(), callback, io_loop.READ)
            io_loop.start()

    .. testoutput::
       :hide:

    By default, a newly-constructed `IOLoop` becomes the thread's current
    `IOLoop`, unless there already is a current `IOLoop`. This behavior
    can be controlled with the ``make_current`` argument to the `IOLoop`
    constructor: if ``make_current=True``, the new `IOLoop` will always
    try to become current and it raises an error if there is already a
    current instance. If ``make_current=False``, the new `IOLoop` will
    not try to become current.

    .. versionchanged:: 4.2
       Added the ``make_current`` keyword argument to the `IOLoop`
       constructor.
    iiiiii iiicC�sGttd�s@tj�#ttd�s7t�t_nWdQXntjS(s1Returns 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.  In most other cases, it is better to use `current()`
        to get the current thread's `IOLoop`.
        t	_instanceN(thasattrRt_instance_lockR(((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytinstance�s
	
cC�s
ttd�S(s8Returns true if the singleton instance has been created.R(RR(((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytinitialized�scC�s tj�st�|t_dS(s�Installs this `IOLoop` object as the singleton instance.

        This is normally not necessary as `instance()` will create
        an `IOLoop` on demand, but you may want to call `install` to use
        a custom subclass of `IOLoop`.
        N(RRtAssertionErrorR(tself((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytinstall�scC�sttd�rt`ndS(sKClear the global `IOLoop` instance.

        .. versionadded:: 4.0
        RN(RRR(((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytclear_instance�scC�s5ttjdd�}|dkr1|r1tj�S|S(s�Returns the current thread's `IOLoop`.

        If an `IOLoop` is currently running or has been marked as
        current by `make_current`, returns that instance.  If there is
        no current `IOLoop`, returns `IOLoop.instance()` (i.e. the
        main thread's `IOLoop`, creating one if necessary) if ``instance``
        is true.

        In general you should use `IOLoop.current` as the default when
        constructing an asynchronous object, and use `IOLoop.instance`
        when you mean to communicate to the main thread from a different
        one.

        .. versionchanged:: 4.1
           Added ``instance`` argument to control the fallback to
           `IOLoop.instance()`.
        RN(tgetattrRt_currenttNoneR(Rtcurrent((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR�s
cC�s|tj_dS(s�Makes this the `IOLoop` for the current thread.

        An `IOLoop` automatically becomes current for its thread
        when it is started, but it is sometimes useful to call
        `make_current` explicitly before starting the `IOLoop`,
        so that code run at startup time can find the right
        instance.

        .. versionchanged:: 4.1
           An `IOLoop` created while there is no current `IOLoop`
           will automatically become current.
        N(RRR(R((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytmake_current�s
cC�sdtj_dS(N(RRRR(((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyt
clear_current�scC�stS(N(R(tcls((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytconfigurable_base�scC�sZttd�r#ddlm}|Sttd�rFddlm}|Sddlm}|S(Ntepolli(tEPollIOLooptkqueue(tKQueueIOLoop(tSelectIOLoop(Rtselectttornado.platform.epollR$ttornado.platform.kqueueR&ttornado.platform.selectR'(R!R$R&R'((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytconfigurable_default�scC�sr|dkr4tjdt�dkrn|j�qnn:|rntjdt�dkratd��n|j�ndS(NRscurrent IOLoop already exists(RRRtFalseRtRuntimeError(RR((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyt
initialize�scC�s
t��dS(s�Closes the `IOLoop`, freeing any resources used.

        If ``all_fds`` is true, all file descriptors registered on the
        IOLoop will be closed (not just the ones created by the
        `IOLoop` itself).

        Many applications will only use a single `IOLoop` that runs for the
        entire lifetime of the process.  In that case closing the `IOLoop`
        is not necessary since everything will be cleaned up when the
        process exits.  `IOLoop.close` is provided mainly for scenarios
        such as unit tests, which create and destroy a large number of
        ``IOLoops``.

        An `IOLoop` must be completely stopped before it can be closed.  This
        means that `IOLoop.stop()` must be called *and* `IOLoop.start()` must
        be allowed to return before attempting to call `IOLoop.close()`.
        Therefore the call to `close` will usually appear just after
        the call to `start` rather than near the call to `stop`.

        .. versionchanged:: 3.1
           If the `IOLoop` implementation supports non-integer objects
           for "file descriptors", those objects will have their
           ``close`` method when ``all_fds`` is true.
        N(tNotImplementedError(Rtall_fds((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytclose�scC�s
t��dS(s�Registers the given handler to receive the given events for ``fd``.

        The ``fd`` argument may either be an integer file descriptor or
        a file-like object with a ``fileno()`` method (and optionally a
        ``close()`` method, which may be called when the `IOLoop` is shut
        down).

        The ``events`` argument is a bitwise or of the constants
        ``IOLoop.READ``, ``IOLoop.WRITE``, and ``IOLoop.ERROR``.

        When an event occurs, ``handler(fd, events)`` will be run.

        .. versionchanged:: 4.0
           Added the ability to pass file-like objects in addition to
           raw file descriptors.
        N(R0(Rtfdthandlertevents((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytadd_handlerscC�s
t��dS(s�Changes the events we listen for ``fd``.

        .. versionchanged:: 4.0
           Added the ability to pass file-like objects in addition to
           raw file descriptors.
        N(R0(RR3R5((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytupdate_handler-scC�s
t��dS(s�Stop listening for events on ``fd``.

        .. versionchanged:: 4.0
           Added the ability to pass file-like objects in addition to
           raw file descriptors.
        N(R0(RR3((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytremove_handler6scC�s
t��dS(s�Sends a signal if the `IOLoop` is blocked for more than
        ``s`` seconds.

        Pass ``seconds=None`` to disable.  Requires Python 2.6 on a unixy
        platform.

        The action parameter is a Python signal handler.  Read the
        documentation for the `signal` module for more information.
        If ``action`` is None, the process will be killed if it is
        blocked for too long.
        N(R0(Rtsecondstaction((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytset_blocking_signal_threshold?scC�s|j||j�dS(s�Logs a stack trace if the `IOLoop` is blocked for more than
        ``s`` seconds.

        Equivalent to ``set_blocking_signal_threshold(seconds,
        self.log_stack)``
        N(R;t	log_stack(RR9((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytset_blocking_log_thresholdMscC�s,tjd|jdjtj|���dS(s|Signal handler to log the stack trace of the current thread.

        For use with `set_blocking_signal_threshold`.
        s#IOLoop blocked for %f seconds in
%stN(Rtwarningt_blocking_signal_thresholdtjoint	tracebacktformat_stack(Rtsignaltframe((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR<Vs	cC�s
t��dS(s�Starts the I/O loop.

        The loop will run until one of the callbacks calls `stop()`, which
        will make the loop stop after the current event iteration completes.
        N(R0(R((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytstart_scC�sGttj�jtjd�jtjd�jg�sCtj�ndS(s�The IOLoop catches and logs exceptions, so it's
        important that log output be visible.  However, python's
        default behavior for non-root loggers (prior to python
        3.2) is to print an unhelpful "no handlers could be
        found" message rather than the actual log entry, so we
        must explicitly configure logging if we've made it this
        far without anything.

        This method should be called from start() in subclasses.
        ttornadostornado.applicationN(tanytloggingt	getLoggerthandlerstbasicConfig(R((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyt_setup_logginggscC�s
t��dS(sAStop the I/O loop.

        If the event loop is not currently running, the next call to `start()`
        will return immediately.

        To use asynchronous methods from otherwise-synchronous code (such as
        unit tests), you can start and stop the event loop like this::

          ioloop = IOLoop()
          async_method(ioloop=ioloop, callback=ioloop.stop)
          ioloop.start()

        ``ioloop.start()`` will return after ``async_method`` has run
        its callback, whether that callback was invoked before or
        after ``ioloop.start``.

        Note that even after `stop` has been called, the `IOLoop` is not
        completely stopped until `IOLoop.start` has also returned.
        Some work that was scheduled before the call to `stop` may still
        be run before the `IOLoop` shuts down.
        N(R0(R((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytstopwsc�s�dg����fd�}�j|�|dk	rY�j�j�|�j�}n�j�|dk	r�j|�n�dj�s�td|��n�dj	�S(s
Starts the `IOLoop`, runs the given function, and stops the loop.

        If the function returns a `.Future`, the `IOLoop` will run
        until the future is resolved.  If it raises an exception, the
        `IOLoop` will stop and the exception will be re-raised to the
        caller.

        The keyword-only argument ``timeout`` may be used to set
        a maximum duration for the function.  If the timeout expires,
        a `TimeoutError` is raised.

        This method is useful in conjunction with `tornado.gen.coroutine`
        to allow asynchronous calls in a ``main()`` function::

            @gen.coroutine
            def main():
                # do stuff...

            if __name__ == '__main__':
                IOLoop.current().run_sync(main)
        c�s�y
��}Wn5tk
rDt��d<�djtj��n8Xt|�r^|�d<nt��d<�dj|��j�d�fd��dS(Nic�s
�j�S(N(RN(tfuture(R(s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyt<lambda>�s(t	ExceptionRtset_exc_infotsystexc_infoRt
set_resultt
add_future(tresult(tfunctfuture_cellR(s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytrun�s




is$Operation timed out after %s secondsN(
Rtadd_callbacktadd_timeoutttimeRNRFtremove_timeouttdoneRRW(RRXttimeoutRZttimeout_handle((RXRYRs4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytrun_sync�s	

"
cC�s
tj�S(sReturns the current time according to the `IOLoop`'s clock.

        The return value is a floating-point number relative to an
        unspecified time in the past.

        By default, the `IOLoop`'s time function is `time.time`.  However,
        it may be configured to use e.g. `time.monotonic` instead.
        Calls to `add_timeout` that pass a number instead of a
        `datetime.timedelta` should use this function to compute the
        appropriate time, so they can work no matter what time function
        is chosen.
        (R](R((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR]�s
cO�stt|tj�r(|j||||�St|tj�r`|j|j�t|�|||�Std|��dS(s�Runs the ``callback`` at the time ``deadline`` from the I/O loop.

        Returns an opaque handle that may be passed to
        `remove_timeout` to cancel.

        ``deadline`` may be a number denoting a time (on the same
        scale as `IOLoop.time`, normally `time.time`), or a
        `datetime.timedelta` object for a deadline relative to the
        current time.  Since Tornado 4.0, `call_later` is a more
        convenient alternative for the relative case since it does not
        require a timedelta object.

        Note that it is not safe to call `add_timeout` from other threads.
        Instead, you must use `add_callback` to transfer control to the
        `IOLoop`'s thread, and then call `add_timeout` from there.

        Subclasses of IOLoop must implement either `add_timeout` or
        `call_at`; the default implementations of each will call
        the other.  `call_at` is usually easier to implement, but
        subclasses that wish to maintain compatibility with Tornado
        versions prior to 4.0 must use `add_timeout` instead.

        .. versionchanged:: 4.0
           Now passes through ``*args`` and ``**kwargs`` to the callback.
        sUnsupported deadline %rN(	t
isinstancetnumberstRealtcall_attdatetimet	timedeltaR]Rt	TypeError(Rtdeadlinetcallbacktargstkwargs((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR\�s
cO�s |j|j�||||�S(s�Runs the ``callback`` after ``delay`` seconds have passed.

        Returns an opaque handle that may be passed to `remove_timeout`
        to cancel.  Note that unlike the `asyncio` method of the same
        name, the returned object does not have a ``cancel()`` method.

        See `add_timeout` for comments on thread-safety and subclassing.

        .. versionadded:: 4.0
        (RfR](RtdelayRkRlRm((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyt
call_later�scO�s|j||||�S(s�Runs the ``callback`` at the absolute time designated by ``when``.

        ``when`` must be a number using the same reference point as
        `IOLoop.time`.

        Returns an opaque handle that may be passed to `remove_timeout`
        to cancel.  Note that unlike the `asyncio` method of the same
        name, the returned object does not have a ``cancel()`` method.

        See `add_timeout` for comments on thread-safety and subclassing.

        .. versionadded:: 4.0
        (R\(RtwhenRkRlRm((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRf�scC�s
t��dS(s�Cancels a pending timeout.

        The argument is a handle as returned by `add_timeout`.  It is
        safe to call `remove_timeout` even if the callback has already
        been run.
        N(R0(RR`((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR^scO�s
t��dS(s3Calls the given callback on the next I/O loop iteration.

        It is safe to call this method from any thread at any time,
        except from a signal handler.  Note that this is the **only**
        method in `IOLoop` that makes this thread-safety guarantee; all
        other interaction with the `IOLoop` must be done from that
        `IOLoop`'s thread.  `add_callback()` may be used to transfer
        control from other threads to the `IOLoop`'s thread.

        To add a callback from a signal handler, see
        `add_callback_from_signal`.
        N(R0(RRkRlRm((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR[s
cO�s
t��dS(sSCalls the given callback on the next I/O loop iteration.

        Safe for use from a Python signal handler; should not be used
        otherwise.

        Callbacks added with this method will be run without any
        `.stack_context`, to avoid picking up the context of the function
        that was interrupted by the signal.
        N(R0(RRkRlRm((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytadd_callback_from_signal$s
cO�s*tj��|j|||�WdQXdS(sgCalls the given callback on the next IOLoop iteration.

        Unlike all other callback-related methods on IOLoop,
        ``spawn_callback`` does not associate the callback with its caller's
        ``stack_context``, so it is suitable for fire-and-forget callbacks
        that should not interfere with the caller.

        .. versionadded:: 4.0
        N(RtNullContextR[(RRkRlRm((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytspawn_callback0s

c�s>t|�st�tj���|j��fd��dS(s�Schedules a callback on the ``IOLoop`` when the given
        `.Future` is finished.

        The callback is invoked with one argument, the
        `.Future`.
        c�s�j�|�S(N(R[(RO(RkR(s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRPGsN(RRRtwraptadd_done_callback(RRORk((RkRs4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRV=scC�s`y;|�}|dk	r:t|�r:|j|d��nWntk
r[|j|�nXdS(sMRuns a callback with error handling.

        For use in subclasses.
        cS�s
|j�S(N(RW(tf((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRPUsN(RRRVRQthandle_callback_exception(RRktret((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyt
_run_callbackIs	
cC�stjd|dt�dS(sUThis method is called whenever a callback run by the `IOLoop`
        throws an exception.

        By default simply logs the exception as an error.  Subclasses
        may override this method to customize reporting of exceptions.

        The exception itself is not passed explicitly, but is available
        in `sys.exc_info`.
        sException in callback %rRTN(RterrortTrue(RRk((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRwYs
cC�s3y|j�|fSWntk
r.||fSXdS(s�Returns an (fd, obj) pair from an ``fd`` parameter.

        We accept both raw file descriptors and file-like objects as
        input to `add_handler` and related methods.  When a file-like
        object is passed, we must retain the object itself so we can
        close it correctly when the `IOLoop` shuts down, but the
        poller interfaces favor file descriptors (they will accept
        file-like objects and call ``fileno()`` for you, but they
        always return the descriptor itself).

        This method is provided for use by `IOLoop` subclasses and should
        not generally be used by application code.

        .. versionadded:: 4.0
        N(tfilenotAttributeError(RR3((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytsplit_fdes
cC�sKy3y|j�Wntk
r1tj|�nXWntk
rFnXdS(skUtility method to close an ``fd``.

        If ``fd`` is a file-like object, we close it directly; otherwise
        we use `os.close`.

        This method is provided for use by `IOLoop` subclasses (in
        implementations of ``IOLoop.close(all_fds=True)`` and should
        not generally be used by application code.

        .. versionadded:: 4.0
        N(R2R}tostOSError(RR3((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pytclose_fdzs

i@I�N(;RRt__doc__t_EPOLLINt	_EPOLLPRIt	_EPOLLOUTt	_EPOLLERRt	_EPOLLHUPt_EPOLLRDHUPt
_EPOLLONESHOTt_EPOLLETtNONEtREADtWRITEtERRORt	threadingtLockRtlocalRtstaticmethodRRRRR{RRR tclassmethodR"R,RR/R-R2R6R7R8R;R=R<RFRMRNRbR]R\RoRfR^R[RqRsRVRyRwR~R�(((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRFsd7
	
																/		"	
						
				t
PollIOLoopcB�s�eZdZdd�Zed�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�ZRS(sBase class for IOLoops built around a select-like function.

    For concrete implementations, see `tornado.platform.epoll.EPollIOLoop`
    (Linux), `tornado.platform.kqueue.KQueueIOLoop` (BSD and Mac), or
    `tornado.platform.select.SelectIOLoop` (all platforms).
    c�s	tt��j|�|�_t�jd�rGt�jj��n|pStj�_i�_	i�_
g�_tj
��_g�_d�_t�_t�_t�_d�_d�_tj��_t��_�j�jj��fd��j�dS(NR|ic�s
�jj�S(N(t_wakertconsume(R3R5(R(s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRP�s(tsuperR�R/t_implRRR|R]t	time_funct	_handlerst_eventst
_callbacksR�R�t_callback_lockt	_timeoutst_cancellationsR-t_runningt_stoppedt_closingRt
_thread_identR@t	itertoolstcountt_timeout_counterR
R�R6R�(RtimplR�Rm((Rs4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR/�s*											cC�s�|j�t|_WdQX|j|jj��|rex-|jj�D]\}}|j|�qEWn|jj	�|j
j	�d|_d|_
dS(N(R�R{R�R8R�R|R�tvaluesR�R2R�RR�R�(RR1R3R4((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR2�s


	cC�sO|j|�\}}|tj|�f|j|<|jj|||jB�dS(N(R~RRtR�R�tregisterR�(RR3R4R5tobj((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR6�scC�s3|j|�\}}|jj|||jB�dS(N(R~R�tmodifyR�(RR3R5R�((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR7�scC�sz|j|�\}}|jj|d�|jj|d�y|jj|�Wn$tk
rutj	ddt
�nXdS(NsError deleting fd from IOLoopRT(R~R�tpopRR�R�t
unregisterRQRtdebugR{(RR3R�((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR8�s
cC�sdttd�s tjd�dS||_|dk	r`tjtj|dk	rS|ntj�ndS(Nt	setitimersPset_blocking_signal_threshold requires a signal module with the setitimer method(RRDRRzR@RtSIGALRMtSIG_DFL(RR9R:((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR;�s
	c	C�s�|jrtd��n|j�|jr8t|_dSttjdd�}|tj_	t
j�|_t
|_d}ttd�r�tjdkr�y>tj|jj��}|dkr�tj|�d}nWq�tk
r�d}q�Xnz}xvt
rk|j�|j}g|_WdQXg}|jr,|j�}xx|jr�|jdjdkr}tj|j�|jd8_q<|jdj|kr�|jtj|j��q<Pq<W|jdkr,|jt |j�d?kr,d|_g|jD]}|jdk	r�|^q�|_tj!|j�q,nx|D]}|j"|�q3Wx0|D](}|jdk	rQ|j"|j�qQqQWd}}}}|jr�d	}	nD|jr�|jdj|j�}	t#dt$|	t%��}	nt%}	|js�Pn|j&dk	rtj'tj(dd�ny|j)j*|	�}
Wn1t+k
rc}t,|�t-j.kr]q�qd�nX|j&dk	r�tj'tj(|j&d�n|j/j0|
�x�|j/r]|j/j1�\}}
y$|j2|\}}|||
�Wq�t3t4fk
r0}t,|�t-j5krqZ|j6|j2j7|��q�t+k
rY|j6|j2j7|��q�Xq�Wd}}q�WWdt|_|j&dk	r�tj'tj(dd�n|tj_	|dk	r�tj|�nXdS(
NsIOLoop is already runningRt
set_wakeup_fdtposixi����iiig(8R�R.RMR�R-RRRRRtthreadt	get_identR�R{RRDRtnameR�R�twrite_filenot
ValueErrorR�R�R�R]RktheapqtheappopR�RjtappendtlentheapifyRytmaxtmint
_POLL_TIMEOUTR@R�tITIMER_REALR�tpollRQR
terrnotEINTRR�tupdatetpopitemR�R�tIOErrortEPIPERwtget(Rtold_currentt
old_wakeup_fdt	callbackstdue_timeoutstnowtxRkR`tpoll_timeouttevent_pairsteR3R5tfd_objthandler_func((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRF�s�	
			



	
			

				
!	cC�s#t|_t|_|jj�dS(N(R-R�R{R�R�twake(R((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRNus		cC�s
|j�S(N(R�(R((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR]zscO�sAt|tjtj|�||�|�}tj|j|�|S(N(t_Timeoutt	functoolstpartialRRtR�theappushR�(RRjRkRlRmR`((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRf}s	cC�sd|_|jd7_dS(Ni(RRkR�(RR`((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR^�s	c	O�s�|j�z|jr"td��n|j}|jjtjtj|�||��|rt	j
�|jkr|jj
�nWdQXdS(NsIOLoop is closing(R�R�R.R�R�R�R�RRtR�R�R�R�R�(RRkRlRmt
list_empty((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR[�s
	
c	O�sjtj��Xtj�|jkr8|j|||�n(|jjtj	tj
|�||��WdQXdS(N(RRrR�R�R�R[R�R�R�R�Rt(RRkRlRm((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRq�s


N(RRR�RR/R-R2R6R7R8R;RFRNR]RfR^R[Rq(((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR��s					
	�						R�cB�s8eZdZdddgZd�Zd�Zd�ZRS(s2An IOLoop timeout, a UNIX timestamp and a callbackRjRkt
tiebreakercC�sMt|tj�s%td|��n||_||_t|j�|_dS(NsUnsupported deadline %r(	RcRdReRiRjRktnextR�R�(RRjRktio_loop((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyt__init__�s
		cC�s"|j|jf|j|jfkS(N(RjR�(Rtother((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyt__lt__�scC�s"|j|jf|j|jfkS(N(RjR�(RR�((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyt__le__�s(RRR�t	__slots__R�R�R�(((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR��s
		tPeriodicCallbackcB�sGeZdZdd�Zd�Zd�Zd�Zd�Zd�Z	RS(sSchedules the given callback to be called periodically.

    The callback is called every ``callback_time`` milliseconds.
    Note that the timeout is given in milliseconds, while most other
    time-related functions in Tornado use seconds.

    If the callback runs for longer than ``callback_time`` milliseconds,
    subsequent invocations will be skipped to get back on schedule.

    `start` must be called after the `PeriodicCallback` is created.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.
    cC�sX||_|dkr$td��n||_|p<tj�|_t|_d|_	dS(Nis4Periodic callback must have a positive callback_time(
RkR�t
callback_timeRRR�R-R�Rt_timeout(RRkR�R�((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR��s			cC�s)t|_|jj�|_|j�dS(sStarts the timer.N(R{R�R�R]t
_next_timeoutt_schedule_next(R((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRF�s	cC�s;t|_|jdk	r7|jj|j�d|_ndS(sStops the timer.N(R-R�R�RR�R^(R((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyRN�s	cC�s|jS(saReturn True if this `.PeriodicCallback` has been started.

        .. versionadded:: 4.1
        (R�(R((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyt
is_running�scC�sX|js
dSz9y|j�SWn$tk
rD|jj|j�nXWd|j�XdS(N(R�RkRQR�RwR�(R((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyt_run�s	
cC�s�|jr�|jj�}|j|krb|jd}|jtj||j|�d|7_n|jj|j|j�|_	ndS(Ng@�@i(
R�R�R]R�R�tmathtfloorR\R�R�(Rtcurrent_timetcallback_time_sec((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR�s	
.N(
RRR�RR�RFRNR�R�R�(((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyR��s					
(0R�t
__future__RRRRRgR�R�R�R�RIRdRR(RSR�R]RBR�ttornado.concurrentRRttornado.logRRRGRttornado.utilR	R
RRDtImportErrorRR�t_threadttornado.platform.autoRR
R�RQRRR�tobjectR�R�(((s4/usr/lib64/python2.7/site-packages/tornado/ioloop.pyt<module>sJ"


��K�#

Zerion Mini Shell 1.0