Comments (5)
My first thought is that this is probably intended to be done by creating 2 connectors/sessions and having different parameters for each.
from aiohttp.
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 limit_per_url
as a nice wraper to move all these "heavy works" from user code into aiohttp.
from aiohttp.
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 limit_per_url
or limit_per_endpoint
(including the HTTP verb) to achieve fine-grained control.
All these sessions will target to the same host, as entreprises often use an API gateway in front of all the private APIs.
from aiohttp.
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.
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.
from aiohttp.
thanks for your shares, I'll close this request.
from aiohttp.
Related Issues (20)
- CancelledError suppressed where it should not HOT 4
- Technical CancelledError bubbling up where it should not HOT 2
- Building wheel for aiohttp (pyproject.toml) did not run successfully.γ βwhen I enterd pip install chess.com in command prompt HOT 5
- wrong server shutdown order? HOT 14
- request tuto/method how to debug unclosed sessions on exit HOT 7
- 404 returned if only compressed file exists
- loop.run_forever terminated by exception HOT 4
- web_ws - Can't close tcp socket when receiving a close message from client. HOT 18
- Large payloads lead to BrokenPipe inside a request context manager HOT 1
- OSError : bind(): bad family HOT 1
- Error upon attempt to download https://dieunbestechlichen.com/feed HOT 3
- aiohttp 3.9.3 fails to install on Python 3.13.0a4 HOT 4
- aiohttp.web listens both TCP and Unix socket if `-U` has been supplied HOT 4
- Stability issues with gunicorn --max-requests HOT 11
- ClientSession cannot reuse connection pool HOT 4
- Using underscore to name a field in a named tuple HOT 2
- Request Pynacl Encryption Middleware HOT 13
- ASGI support HOT 4
- tests/test_pytest_plugin.py::test_aiohttp_plugin fails on Alpine Linux (python 3.11 and python 3.12) HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiohttp.