Python asyncio task ordering
问题 I have a question about how the event loop in python's asyncio module manages outstanding tasks. Consider the following code: import asyncio @asyncio.coroutine def a(): for i in range(0, 3): print('a.' + str(i)) yield @asyncio.coroutine def b(): for i in range(0, 3): print('b.' + str(i)) yield @asyncio.coroutine def c(): for i in range(0, 3): print('c.' + str(i)) yield tasks = [ asyncio.Task(a()), asyncio.Task(b()), asyncio.Task(c()), ] loop = asyncio.get_event_loop() loop.run_until_complete