|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /opt/alt/python37/lib64/python3.7/site-packages/aiohttp/__pycache__/ |
Upload File : |
B
�k�a� � @ s6 d dl Z d dlZd dlmZmZmZ G dd� d�ZdS )� N)�Any�Deque�Optionalc @ sT e Zd ZdZejdd�dd�Zdee dd�dd�Z e
d �d
d�Zdd �dd
�ZdS )�EventResultOrErrorz�Event asyncio lock helper class.
Wraps the Event asyncio lock allowing either to awake the
locked Tasks without any error or raising an exception.
thanks to @vorpalsmith for the simple design.
N)�loop�returnc C s$ || _ d | _t�� | _t�� | _d S )N)�_loop�_exc�asyncioZEvent�_event�collections�deque�_waiters)�selfr � r �@/opt/alt/python37/lib64/python3.7/site-packages/aiohttp/locks.py�__init__ s
zEventResultOrError.__init__)�excr c C s || _ | j�� d S )N)r r �set)r r r r r r s zEventResultOrError.set)r c � sP | j �| j�� �}| j�|� z|I d H }W d | j�|� X | jd k rL| j�|S )N)r Zcreate_taskr �waitr �append�remover )r �waiter�valr r r r s
zEventResultOrError.waitc C s x| j D ]}|�� qW dS )zCancel all waitersN)r �cancel)r r r r r r &