Sessions shouldn't be created with every request
Closed this issue · 1 comments
aiohttp docs state
Note
Don’t create a session per request. Most likely you need a session per application which performs all requests altogether.
More complex cases may require a session per site, e.g. one for Github and other one for Facebook APIs. Anyway making a session for every request is a very bad idea.
A session contains a connection pool inside. Connection reusage and keep-alives (both are on by default) may speed up total performance.
We abuse that in quite a lot of places
fastapi-discord/fastapi_discord/client.py
Line 54 in ced6b8c
fastapi-discord/fastapi_discord/client.py
Line 58 in ced6b8c
fastapi-discord/fastapi_discord/client.py
Line 76 in ced6b8c
fastapi-discord/fastapi_discord/client.py
Line 88 in ced6b8c