Skip to content
Myr

[Docs] Add AnyIO under "Supported async environments" (#1673)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* [Docs] Add AnyIO under "Supported async environments" * Update docs/async.md Co-authored-by: Florimond Manca <15911462+florimondmanca@users.noreply.github.com>

authored by Vibhu Agarwal · committed by GitHub · parent 604d09d · Browse files · 1 file+23 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Florimond Manca <15911462+florimondmanca@users.noreply.github.com>
  • Co-authored-by: Tom Christie <tom@tomchristie.com>

Diff stats

1 file+23 added−0 removed

  • other:+23 added−0 removed

1 file+23 added−0 removed

modified:docs/async.md+23 added
188 unmodified lines
189190!!! important191 The `curio` package must be installed to use the Curio backend.192193194### [AnyIO](https://github.com/agronholm/anyio)195196AnyIO is an [asynchronous networking and concurrency library](https://anyio.readthedocs.io/) that works on top of either `asyncio` or `trio`. It blends in with native libraries of your chosen backend (defaults to `asyncio`).197198```python199import httpx200import anyio201202async def main():203 async with httpx.AsyncClient() as client:204 response = await client.get('https://www.example.com/')205 print(response)206207anyio.run(main, backend='trio')208```209210When instantiating a transport instance explicitly, for maximum consistency, the same `backend` parameter can be passed to `AsyncHTTPTransport`.211```python212transport = httpx.AsyncHTTPTransport(backend="trio")213```214215216## Calling into Python Web Apps217218Just as `httpx.Client` allows you to call directly into WSGI web applications,219the `httpx.AsyncClient` class allows you to call directly into ASGI web applications.
49 unmodified lines