Open lordmauve opened 4 years ago
asyncio.gather() is a function for awaiting several coroutines at once.
asyncio.gather()
Users should be able to write something not dissimilar to
await gather( some_coro(), another_coro() )
Perhaps related, the task object returned by clock.coro.run() should have an async def join() so that you can await it finishing:
clock.coro.run()
async def join()
task = clock.coro.run(...) await task.join()
This can be used to implement gather:
async def gather(*coros, clock=None): clock = clock or get_my_clock() tasks = [clock.coro.run(t) for t in coros] for t in tasks: await t.join()
asyncio.gather()
is a function for awaiting several coroutines at once.Users should be able to write something not dissimilar to
Perhaps related, the task object returned by
clock.coro.run()
should have anasync def join()
so that you can await it finishing:This can be used to implement gather: