Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/tornado/__pycache__/concurrent.cpython-39.pyc
Ðазад
a _�h! � @ s� d Z ddlZddlmZ ddlZddlZddlZddlmZ ddl Z ddl m Z mZmZm Z mZ e �d�ZG dd� de�ZejZejefZe ed �d d�ZG dd � d ej�Ze� Ze e ed�dd�Ze� Zdddd�dd�Zdedd�dd�Zdedd�dd�Z de ee! ee eej" f dd�dd�Z#e j$dedgdf dd �d!d"��Z%e j$dedgdf dd �d#d"��Z%ded$ dd �d%d"�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 @ s e Zd ZdS )�ReturnValueIgnoredErrorN)�__name__� __module__�__qualname__� r r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/tornado/concurrent.pyr * s r )�x�returnc C s t | t�S �N)� isinstance�FUTURES)r r r r � is_future4 s r c @ s: e Zd Zedef eedd�dd�Zdedd�d d �ZdS )� DummyExecutor.�futures.Future[_T])�fn�args�kwargsr c O sF t �� }zt|||i |��� W n ty@ t|t�� � Y n0 |S r )r �Future�"future_set_result_unless_cancelled� Exception�future_set_exc_info�sys�exc_info)�selfr r r �futurer r r �submit9 s zDummyExecutor.submitTN)�waitr c C s d S r r )r! r$ r r r �shutdownC s zDummyExecutor.shutdown)T) r r r r r r r# �boolr% r r r r r 8 s � r )r r r c sb t t dtf d�� fdd�}| r,� r,td��t| �dkrD|| d �S t| �dkr^tdt| ���|S ) a� Decorator to run a synchronous method asynchronously on an executor. The decorated method may be called with a ``callback`` keyword argument and 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. .)r r c s4 �� dd�� t���ttttd�� �fdd��}|S )N�executor)r! r r r c s4 t � }t| � �j�| g|�R i |��}t||� |S r )r �getattrr# �chain_future)r! r r Zasync_futureZconc_future�r'