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
* Version 1.0
* Keep Trio support at trio==0.21.
* Add note in 'trace' extension docs to make it clear that trace events could change across package versions.
* Fix installation docs
* Fix installation messages
* Update trio, anyio versions
* Update CHANGELOG
* Remove sniffio as a direct dependency
---------
Co-authored-by: Kar Petrosyan <[email protected]>
Copy file name to clipboardExpand all lines: docs/async.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,22 @@ If you're working with an async web framework then you'll also want to use an as
8
8
9
9
Launching concurrent async tasks is far more resource efficient than spawning multiple threads. The Python interpreter should be able to comfortably handle switching between over 1000 concurrent tasks, while a sensible number of threads in a thread pool might be to enable around 10 or 20 concurrent threads.
10
10
11
+
## Enabling Async support
12
+
13
+
If you're using async with [Python's stdlib `asyncio` support](https://docs.python.org/3/library/asyncio.html), install the optional dependencies using:
14
+
15
+
```shell
16
+
$ pip install 'httpcore[asyncio]'
17
+
```
18
+
19
+
Alternatively, if you're working with [the Python `trio` package](https://trio.readthedocs.io/en/stable/):
20
+
21
+
```shell
22
+
$ pip install 'httpcore[trio]'
23
+
```
24
+
25
+
We highly recommend `trio` for async support. The `trio` project [pioneered the principles of structured concurrency](https://en.wikipedia.org/wiki/Structured_concurrency), and has a more carefully constrained API against which to work from.
26
+
11
27
## API differences
12
28
13
29
When using async support, you need make sure to use an async connection pool class:
Copy file name to clipboardExpand all lines: docs/extensions.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,6 +147,8 @@ The following event types are currently exposed...
147
147
*`"http2.receive_response_body"`
148
148
*`"http2.response_closed"`
149
149
150
+
The exact set of trace events may be subject to change across different versions of `httpcore`. If you need to rely on a particular set of events it is recommended that you pin installation of the package to a fixed version.
151
+
150
152
### `"sni_hostname"`
151
153
152
154
The server's hostname, which is used to confirm the hostname supplied by the SSL certificate.
Copy file name to clipboardExpand all lines: docs/http2.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ When using the `httpcore` client, HTTP/2 support is not enabled by default, beca
15
15
If you're issuing highly concurrent requests you might want to consider trying out our HTTP/2 support. You can do so by first making sure to install the optional HTTP/2 dependencies...
16
16
17
17
```shell
18
-
$ pip install httpcore[http2]
18
+
$ pip install 'httpcore[http2]'
19
19
```
20
20
21
21
And then instantiating a connection pool with HTTP/2 support enabled:
0 commit comments