B °¤ï`Äã@sdddlZddlZddlmZmZyddlmZWn 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ÚasyncioÚEventÚ_eventÚ collectionsÚdequeÚ_waiters)Úselfr©rúh/private/var/folders/7j/8686xlfs15q3tgljmghtvg0r0000gn/T/pip-target-isidps9b/lib/python/aiohttp/locks.pyÚ__init__s zEventResultOrError.__init__)ÚexcrcCs||_|j ¡dS)N)r r Úset)rrrrrrszEventResultOrError.set)rc ÃsP|j |j ¡¡}|j |¡z|IdH}Wd|j |¡X|jdk rL|j‚|S)N)rZ create_taskr ÚwaitrÚappendÚremover )rÚwaiterÚvalrrrrs  zEventResultOrError.waitcCsx|jD] }| ¡qWdS)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