U 'â7`Äã@sdddlZddlZddlmZmZzddlmZWn ek rPddlmZYnXGdd„dƒZdS)éN)ÚAnyÚOptional)ÚDequec@sTeZdZdZejddœdd„Zdeeddœdd„Z e d œd d „Z dd œd d „Z dS)Ú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ÚreturncCs$||_d|_t ¡|_t ¡|_dS©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__)ÚexcrcCs||_|j ¡dSr)r r Úset)rrrrrrszEventResultOrError.set)rc ÃsP|j |j ¡¡}|j |¡z|IdH}W5|j |¡X|jdk rL|j‚|Sr)r Z create_taskr ÚwaitrÚappendÚremover )rÚwaiterÚvalrrrrs  zEventResultOrError.waitcCs|jD] }| ¡qdS)z Cancel all waiters N)rÚcancel)rrrrrr*s zEventResultOrError.cancel)N) Ú__name__Ú __module__Ú __qualname__Ú__doc__r ZAbstractEventLooprrÚ BaseExceptionrrrrrrrrr s  r) r r ÚtypingrrrÚ ImportErrorZtyping_extensionsrrrrrÚs