coro_queue¶
-
class
async_patterns.coro_queue.
CoroQueue
(loop)[source]¶ A queue of coroutines to be called sequentially.
Parameters: loop – event loop -
join
()[source]¶ Wait for all coroutines to finish. Await the underlying
asyncio.Queue
object’s join method.This method is a
coroutine
.
-
-
class
async_patterns.coro_queue.
CoroQueueClass
(queue=None, loop=None)[source]¶ Provide a method wrapper that schedules execution of the wrapped function using a
CoroQueue
object.class Foo(CoroQueueClass): @CoroQueueClass.wrap async def a(self): await asyncio.sleep(1) async def test(loop): f = Foo() f._loop = loop await f.a() await f.close() loop.run_until_complete(test(loop))