You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/network-backends.md
+22-1
Original file line number
Diff line number
Diff line change
@@ -73,8 +73,29 @@ while True:
73
73
74
74
If we're working with an `async` codebase, then we need to select a different backend.
75
75
76
-
The `httpcore.AnyIOBackend` is suitable for usage if you're running under `asyncio`. This is a networking backend implemented using [the `anyio` package](https://anyio.readthedocs.io/en/3.x/).
76
+
These `async` network backends are available:
77
+
-`httpcore.AsyncioBackend` This networking backend is implemented using Pythons native `asyncio`.
78
+
-`httpcore.AnyIOBackend` This is implemented using [the `anyio` package](https://anyio.readthedocs.io/en/3.x/).
79
+
-`httpcore.TrioBackend` This is implemented using [`trio`](https://trio.readthedocs.io/en/stable/).
77
80
81
+
Currently by default `AnyIOBackend` is used when running with `asyncio` (this may change).
82
+
`TrioBackend` is used by default when running with `trio`.
83
+
84
+
Using `httpcore.AsyncioBackend`:
85
+
```python
86
+
import httpcore
87
+
import asyncio
88
+
89
+
asyncdefmain():
90
+
network_backend = httpcore.AsyncioBackend()
91
+
asyncwith httpcore.AsyncConnectionPool(network_backend=network_backend) as http:
0 commit comments