Skip to content

Renaming PoolLimits -> Limits. #1094

Closed

Description

@lovelydinosaur

Another 1.0 final run-in bit of polishing here...

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.

Activity

  1. added this to the v0.14 milestone on Jul 27, 2020
  2. lovelydinosaur commented on Jul 30, 2020

    @lovelydinosaur
    MemberAuthor

    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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    user-experienceEnsuring that users have a good experience using the library

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions