python asyncio
例子
1 | import asyncio |
主要函数
task = asyncio.create_tas()
res = await asyncio.gather(task1, task2) # res: list
获取返回值
res = await task
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
1 | import asyncio |
task = asyncio.create_tas()
res = await asyncio.gather(task1, task2) # res: list
res = await task