-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Make DEFAULT_LIMIT monkey patchable #4696
Conversation
Currently its not possible to change DEFAULT_LIMIT. This change allows this ``` import aiohttp aiohttp.streams.DEFAULT_LIMIT = 10 * aiohttp.streams.DEFAULT_LIMIT ```
@webknjaz could you review this change, too? It would fix my application from crashing. |
I changed it as requested - it should be possible to merge this. |
Is there anything I can do to get this merged? |
I am another user who would like to see this functionality. |
@webknjaz : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't support this PR.
If you want to change the default buffer size -- please pass the desired value into client.get()
or a similar call instead of monkey-patching. ClientSession
can accept the session-default value as the argument constructor as well.
Sure, it requires a bigger pull request than initially proposed but I believe that explicit way is much better.
Thank you for your reply. The crash happens when using aiohttp together with aiohttp-sse-client but I think if it's a possible Session arg this would be still fine. I am just looking for any (simple) way to change the buffer so my application doesn't go down with an exception |
@spacemanspiff2007 sorry again, I misled you and myself by writing controversial recommendations. To don't bother you again I've prepared a fix myself as #5065 |
Closing the PR for the sake of #5056 |
Thank you very much for your efforts and for the solution! |
Got it. Thanks for addressing this issue. |
What do these changes do?
Currently its not possible to change DEFAULT_LIMIT.
This change allows this:
Are there changes in behavior for the user?
No
Related issue number
#4453
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.