Create generator that yields coroutine results as the coroutines finish
asyncio.as_completed() takes an iterable of coroutines or futures and returns an iterable of futures in the order that the input futures complete. Normally, you’d loop over its result and await the members from inside an async function… import asyncio async def first(): await asyncio.sleep(5) return ‘first’ async def second(): await asyncio.sleep(1) return ‘second’ async def … Read more