def async_main(max_pkgs=MAX_PKGS): # ~ 32 secs for 200 pkgs on my MacBookPro
loop = asyncio.get_event_loop()
client = ServerProxy(PYPI_URL)
futures = [loop.run_in_executor(None, get_pkg_info, pkg_name, downloads)
for pkg_name, downloads in client.top_packages(max_pkgs)]
return [(yield from fut) for fut in futures]
pypi_top200_async_old.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录