-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCPConnector / enable limit_per_url
#8206
Comments
My first thought is that this is probably intended to be done by creating 2 connectors/sessions and having different parameters for each. |
Yes, using multiple sessions can work as well. However, my actual use case involves having multiple endpoints behind the same host, each with different maximum concurrency limits. Managing multiple sessions might become burdensome due to the need for numerous variables in the code and extensive conditional logic to select the appropriate session object for different endpoints, etc. That's why I asked for |
I can even envision, if possible, having two levels of sessions. The first level would involve creating multiple sessions for different groups of endpoints, such as a session for financial team endpoints, another for sales team endpoints, and one more for technical team endpoints, etc. The second level would entail, within each session, leveraging All these sessions will target to the same host, as entreprises often use an API gateway in front of all the private APIs. |
I think that's called a dict. ;) I'm not saying that it's a terrible idea, but it seems like a bit of an obscure use case we'd then need to maintain. It could also have a performance impact on other users depending on how it's implemented. So, I suspect there won't be much interest in implementing it. Either way, if you want something that works now (or even this year), you'll be best using multiple sessions. |
thanks for your shares, I'll close this request. |
Is your feature request related to a problem?
No response
Describe the solution you'd like
currenly we have
limit
andlimit_per_host
optiions, but my use case is that, I have many API behind the same host, but only one of them has the max concurrent reuqests limit, so I need a new param likelimit_per_url
, ideally with the httpmethod
also.Describe alternatives you've considered
currently, I'm using asyncio.semaphore to achieve that.
Related component
Client
Additional context
aiohttp.TCPConnector
Code of Conduct
The text was updated successfully, but these errors were encountered: