亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

python - asyncio.wait和asyncio.gather的區(qū)別?
天蓬老師
天蓬老師 2017-04-18 10:26:40
0
2
1052

剛學(xué)PYTHON的協(xié)程,我想請教下,這兩段代碼執(zhí)行起來有什么區(qū)別呢?

tasks = [asyncio.ensure_future(task(i)) for i in range(0,300)]
loop.run_until_complete(asyncio.gather(*tasks))

tasks = [task(i) for i in range(0,300)]
loop.run_until_complete(asyncio.wait(tasks))


天蓬老師
天蓬老師

歡迎選擇我的課程,讓我們一起見證您的進(jìn)步~~

reply all(2)
巴扎黑

Just look at the documentation and you will know that these two pieces of code have the same effect. However, the return values ??of wait and gather are different. Wait can also return when the first future is complete or an error occurs.

PHPzhong

RTFM......

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template