-
-
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
Work with files asynchronously #3313
Comments
Do not forget to I think, internal API should be the following: import aiofiles
file = await aiofiles.open()
result = await file.read()
result = await file.write()
await file.chmod()
await file.fsync()
... UPD: https://github.com/Tinche/aiofiles buth this solution is overingeneered. I would write my own with implementing each method explicitly. |
I don't want to use aiofiles. |
👋 would love to pick this up, if not fixed already |
Please go ahead! |
This could raise a holywar, but I'll risk to ask you: why not aiofiles? |
Did you read messages above? |
Yes, I did, but some abstraction may be useful to not care about that bit if it will eventually have changed. If that's the only reason than it satisfied my curiousity (: |
Changes will not touch the public API. |
Done |
Woop woop. This is great. Thanks @Tolmachofof |
There is a very old tech debt in aiohttp: the library uses blocking synchronous calls to work with files.
It should be fixed by replacement such direct calls by
loop.run_in_executor()
.Affected parts:
web_fileresponse.py
payload.py
Splitting the task into two pull requests makes sense in term of easier review.
The issue is pretty easy and straightforward, it waits for a champion.
The text was updated successfully, but these errors were encountered: