bgpDddlZddlZddlmZmZmZGddZdS)N)AnyDequeOptionalc^eZdZdZdejddfdZd deeddfdZ de fdZ d d Z dS) EventResultOrErrorzEvent 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. loopreturnNc||_d|_tj|_t j|_dSN)_loop_excasyncioEvent_event collectionsdeque_waiters)selfrs D/opt/cloudlinux/venv/lib64/python3.11/site-packages/aiohttp/locks.py__init__zEventResultOrError.__init__s1 -1 moo 4?4E4G4G exccF||_|jdSr )r rset)rrs rrzEventResultOrError.sets!  rcBK|j|j}|j| |d{V}|j|n#|j|wxYw|j|j|Sr )r create_taskrwaitrappendremover )rwaitervals rrzEventResultOrError.waits'' (8(8(:(:;; V$$$ ),,,,,,C M  ( ( ( (DM  ( ( ( ( 9 )O s A22BcB|jD]}|dS)zCancel all waitersN)rcancel)rr s rr#zEventResultOrError.cancel&s,m  F MMOOOO  rr )r N) __name__ __module__ __qualname____doc__rAbstractEventLooprr BaseExceptionrrrr#rrrrsHW6H4HHHH x .$ C    rr)rrtypingrrrrr*rrr,sj''''''''''##########r