Viewing File: /opt/alt/python38/lib64/python3.8/site-packages/aiohttp/__pycache__/locks.cpython-38.opt-1.pyc
U
'â7`Ä ã @ sd d dl Z d dlZd dlmZmZ zd dlmZ W n ek
rP d dlmZ Y nX G dd„ dƒZdS )é N)ÚAnyÚOptional)ÚDequec @ sT e Zd ZdZejddœdd„Zdee ddœdd„Z e
d œd
d„Zdd œdd
„ZdS )ÚEventResultOrErrorz½
This class wrappers the Event asyncio lock allowing either 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/python38/lib64/python3.8/site-packages/aiohttp/locks.pyÚ__init__ s
zEventResultOrError.__init__)Úexcr c C s || _ | j ¡ d S r )r
r Úset)r r r r r r s zEventResultOrError.set)r c à sP | j | j ¡ ¡}| j |¡ z|I d H }W 5 | j |¡ X | jd k rL| j‚|S r )r Zcreate_taskr Úwaitr ÚappendÚremover
)r ÚwaiterÚvalr r r r s
zEventResultOrError.waitc C s | j D ]}| ¡ qdS )z Cancel all waiters N)r Úcancel)r r r r r r * s
zEventResultOrError.cancel)N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r ZAbstractEventLoopr r Ú
BaseExceptionr r r r r r r r r s
r ) r r
Útypingr r r ÚImportErrorZtyping_extensionsr r r r r Ú<module> s
Back to Directory
File Manager