asyncio的事件循环的替代方案
1、参考来源
https://github.com/MagicStack/uvloop
2、环境要求
不支持Windows系统
3、安装模块
pip3 install uvloop
pip3 install -U pip
4、引用的示例
1 import asyncio 2 import sys 3 4 import uvloop 5 6 async def main(): 7 # Main entry-point. 8 ... 9 10 if sys.version_info >= (3, 11): 11 with asyncio.Runner(loop_factory=uvloop.new_event_loop) as runner: 12 runner.run(main()) 13 else: 14 uvloop.install() 15 asyncio.run(main())