常见问题¶
Frequently Asked Questions
为什么 Curio 不支持作为后端?¶
Why is Curio not supported as a backend?
在 AnyIO 3.0 之前版本中,AnyIO 支持 Curio。支持被移除的原因有以下两点:
Curio was supported in AnyIO before v3.0. Support for it was dropped for two reasons:
Its interface allowed only coroutine functions to access the Curio kernel. This forced AnyIO to follow suit in its own API design, making it difficult to adapt existing applications that relied on synchronous callbacks to use AnyIO. It also interfered with the goal of matching Trio's API in functions with the same purpose (e.g.
Event.set()
).The maintainer specifically requested Curio support to be removed from AnyIO (issue 185).
为什么 Twisted 不支持作为后端?¶
Why is Twisted not supported as a backend?
支持 Twisted 的最低要求是 sniffio 能够检测到正在运行的 Twisted 事件循环(并能够识别 Twisted 是否在其 asyncio reactor 上运行)。目前, sniffio 不支持此功能,因此 AnyIO 也无法支持 Twisted。
如果您对 AnyIO 中的 Twisted 支持感兴趣,可以关注 Twisted 的相关 问题 。
The minimum requirement to support Twisted would be for sniffio to be able to detect a running Twisted event loop (and be able to tell when Twisted is being run on top of its asyncio reactor). This is not currently supported in sniffio, so AnyIO cannot support Twisted either.
There is a Twisted issue that you can follow if you're interested in Twisted support in AnyIO.