관리-도구
편집 파일: concurrency.cpython-38.pyc
U -?�f� � @ sT d dl mZ d dlZd dlZd dlmZ d dlmZ d dlmZ d dlmZ dZdZ zd dl Z W n* ek r� Z ze e�Z W 5 dZ[X Y nZX dZd d lmZ d dlmZ d dlmZ d d lmZ d dlmZ d dlmZ d dlmZ ed�ZG dd� d�Zej�sPe�sPdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zd d!� Zd"d#� Zd$d%� ZdS )&� )�annotationsN)�Any)�Callable)� Coroutine)�TypeVarFT� )� await_only)�await_fallback)�in_greenlet)�greenlet_spawn)�is_exit_exception)�AsyncAdaptedLock)�_Runner�_Tc @ sT e Zd ZdZdd�dd�Zddddd �d d�Zddddd �d d�Zdd�dd�ZdS )� _AsyncUtilz&Asyncio util for test suite/ util only�None)�returnc C s t rt� | _d S �N)� have_greenletr �runner��self� r �K/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/util/concurrency.py�__init__) s z_AsyncUtil.__init__z&Callable[..., Coroutine[Any, Any, _T]]r r )�fn�args�kwargsr c O s | j �|||��S )zRun coroutine on the loop)r �run�r r r r r r r r - s z_AsyncUtil.runzCallable[..., _T]c O sD t r6| j�� �� r|||�S | j�t|f|�|��S n |||�S dS )z3Run sync function in greenlet. Support nested callsN)r r Zget_loopZ is_runningr r r r r r �run_in_greenlet6 s z_AsyncUtil.run_in_greenletc C s t r| j�� d S r )r r �closer r r r r! B s z_AsyncUtil.closeN)�__name__� __module__�__qualname__�__doc__r r r r! r r r r r &