Skip to content
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

Cache aiohttp.ClientSession #83

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

averyanalex
Copy link

From aiohttp docs:

The session contains a cookie storage and connection pool, thus cookies and connections are shared between HTTP requests sent by the same session.

Thus, using the same ClientSession can speed up execution of multiple requests in a row.

@averyanalex
Copy link
Author

This also fixed OSError: [WinError 121] The semaphore timeout period has expired error in my program that sends 100 requests at the same time.

@averyanalex averyanalex marked this pull request as draft February 4, 2024 18:00
@averyanalex averyanalex marked this pull request as ready for review February 4, 2024 18:13
@dotX12
Copy link
Collaborator

dotX12 commented Feb 18, 2024

@averyanalex, hi!
Oh, this is a serious update that will entail a major change in the code for users. I'll think about how this can be done better...

@averyanalex
Copy link
Author

@averyanalex, hi! Oh, this is a serious update that will entail a major change in the code for users. I'll think about how this can be done better...

My friend told me that .stop() is not the best way. It maybe can be done more correctly with context manager. Sorry for my english.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants