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
I think we should probably renaming pool_limits=... to limits=... and httpx.PoolLimits(...) to httpx.Limits(...).
If we are going to do this, then we should do so with a gentle deprecation, and we should target 0.14.
There's two motivations here...
Prefer a more concise style.
At some point we may have limits that are not strictly to do with the connection pool. (For example, it'd be helpful particularly with the AsyncClient to be able to enforce a client-wide max concurrent outgoing requests. Which we might just want to unilaterally apply across all mounted transports/proxies)
I'm open to push back on this if anyone thinks this is a bit over-zealous, and I am mindful that it introduces a bit of thrash. On the flip side, if there's a time to do this, then pre-1.0 is the time.
Some other thoughts around why this be a good renaming too. There's a few other limits we might want to put in place, that are not necessarily "PoolLimits". I've included some possible future examples here...
max_response_size = 100_000_000 # Raise an error on any responses >100MB.
keepalive_expiry = 5.0 # Control the HTTP keep alive duration.
max_concurrent_requests = 100 # Client-wide semaphore over all requests.
max_request_duration = 60.0 # Raise an error on responses that exceed 1 minute total download time.
Activity
lovelydinosaur commentedon Jul 30, 2020
Some other thoughts around why this be a good renaming too. There's a few other limits we might want to put in place, that are not necessarily "PoolLimits". I've included some possible future examples here...
max_response_size = 100_000_000# Raise an error on any responses >100MB.keepalive_expiry = 5.0# Control the HTTP keep alive duration.max_concurrent_requests = 100# Client-wide semaphore over all requests.max_request_duration = 60.0# Raise an error on responses that exceed 1 minute total download time.