Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
asyncio是 python 3.4 的事件驱动核心库。我知道twisted,一个类似的lib forasyncio实现了该Reactor模式,但是实现了什么样的模式asyncio呢?
asyncio
Reactor
好吧,它使用reactor for posix。Windows 实现也有前摄器事件循环。
正如@AndrewSvetlov 回答的那样,Python 已经会根据您的操作系统为您选择性能最高的选择器。不同的选择器事件循环将确保获得最紧凑的循环,您的操作系统上可用的性能最高的选择器。所以它实现了这两种模式。