📝 Docs previewLast commit 70fed28 at: https://e8589395.fastapitiangolo.pages.dev Modified Pages |
Sorry, something went wrong.
There was a problem hiding this comment.
I wouldn't say that current note text is "misleading" - for those who read docs in the order everything should be clear.
I think it just "can be a bit better".
But this edit makes sense to me.
Passing this to Sebastian for review
Sorry, something went wrong.
Description
This PR clarifies the misleading "async Technical Details" note in the UploadFile documentation.
File: docs/en/docs/tutorial/request-files.md
https://github.com/fastapi/fastapi/blob/master/docs/en/docs/tutorial/request-files.md
Current Issue
The current note states:
"When you use the async methods, FastAPI runs the file methods in a threadpool and awaits for them."
While technically accurate, this is misleading because:
Solution
The updated note now explains:
Technical Background
Evidence from source code (fastapi/datastructures.py):
Each async method has a docstring: "To be awaitable, compatible with async, this is run in threadpool."
Evidence from documentation (docs/en/docs/async.md, line 418):
FastAPI explicitly states threadpool is used for def functions, implying async def should NOT use threadpool except for blocking I/O (which requires special handling).
New Text