File: //usr/local/CyberPanel/lib/python3.10/site-packages/tornado/__pycache__/concurrent.cpython-310.pyc
o
��hs � @ s� d Z ddlZddlmZ ddlZddlZddlZddlmZ ddl Z ddl m
Z
mZmZm
Z
mZ e �d�ZG dd� de�ZejZejefZd e
d
efdd�ZG d
d� dej�Ze� Zde
de
d
efdd�Ze� Zd*dd�Zddded
dfdd�Zddded
dfdd�Z ddd e
ee! ee eej" f d
dfd!d"�Z#e j$dd#d$ed#gdf d
dfd%d&��Z%e j$ddd$edgdf d
dfd'd&��Z%ddd$ed( d
dfd)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 �H/usr/local/CyberPanel/lib/python3.10/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 @ sh e Zd Zdedef dededdfdd�Zejd kr(dde d
e ddfdd�Z
dS dde ddfdd�Z
dS )�
DummyExecutor�fn.�args�kwargsr �futures.Future[_T]c O sF t �� }z
t|||i |��� W |S ty" t|t�� � Y |S w 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.submit)� � TF�wait�cancel_futuresNc C � d S r r )r! r&