File: faq.rst

package info (click to toggle)
python-anyio 4.8.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,108 kB
  • sloc: python: 14,231; sh: 21; makefile: 9
file content (31 lines) | stat: -rw-r--r-- 1,395 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Frequently Asked Questions
==========================

Why is Curio not supported as a backend?
----------------------------------------

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 <https://github.com/agronholm/anyio/issues/185>`_).

.. _Curio: https://github.com/dabeaz/curio

Why is Twisted not supported as a backend?
------------------------------------------

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 <https://github.com/twisted/twisted/pull/1263>`_ that you can
follow if you're interested in Twisted support in AnyIO.

.. _Twisted: https://twistedmatrix.com/trac/
.. _sniffio: https://github.com/python-trio/sniffio