Skip to content
Myr

Tweak advanced timeouts docs (#1420)

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

authored by Florimond Manca · committed by GitHub · parent 7ea6019 · Browse files · 1 file+2 added−3 removed
This commit

State

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

Diff stats

1 file+2 added−3 removed

  • other:+2 added−3 removed

1 file+2 added−3 removed

modified:docs/advanced.md+2 added-3 removed
631 unmodified lines
632There are four different types of timeouts that may occur. These are **connect**,633**read**, **write**, and **pool** timeouts.634635* The **connect** timeout specifies the maximum amount of time to wait until636a connection to the requested host is established. If HTTPX is unable to connect636a socket connection to the requested host is established. If HTTPX is unable to connect637within this time frame, a `ConnectTimeout` exception is raised.638* The **read** timeout specifies the maximum duration to wait for a chunk of639data to be received (for example, a chunk of the response body). If HTTPX is640unable to receive data within this time frame, a `ReadTimeout` exception is raised.
3 unmodified lines
644* The **pool** timeout specifies the maximum duration to wait for acquiring645a connection from the connection pool. If HTTPX is unable to acquire a connection646within this time frame, a `PoolTimeout` exception is raised. A related647configuration here is the maximum number of allowable connections in the648connection pool, which is configured by the `pool_limits`.648connection pool, which is configured by the `limits` argument.649650You can configure the timeout behavior for any of these values...651652```python
13 unmodified lines
666allow. (Defaults 10)667- `max_connections`, maximum number of allowable connections, or` None` for no limits.668(Default 100)669670670```python671limits = httpx.Limits(max_keepalive_connections=5, max_connections=10)672client = httpx.Client(limits=limits)673```
437 unmodified lines