Allow changing connector limit on runtime
Is your feature request related to a problem?
I want to reduce my connection limit on getting rate-limited.
A web server can decide to rate-limit number of connections out of the blue.
Describe the solution you'd like
Allow changing Session.connector.limit.
Describe alternatives you've considered
- Enforcing limit manually in a subclass.
- Changing
Session.connector._limit.
Both can be avoided if the functionality is provided directly.
Related component
Client
Additional context
No response
Code of Conduct
- [x] I agree to follow the aio-libs Code of Conduct
Hi, I’d like to take this up and open a PR. The plan is to add a safe, public way to change Session.connector.limit at runtime, so users don’t need to rely on private attributes or subclassing. If there are any design preferences (e.g., method naming, exposure via ClientSession vs. connector), please let me know before I start. Thanks!
Is your usecase the same as above? I'm kind of struggling to see how this would be generally useful. The original issue mentions rate limiting, but in the vast majority of cases this would be a limit on the frequency of requests, not a limit on the number of simultaneous connections. There are better solutions for rate limiting.