Browse Source

docs: clarify async technical details for UploadFile methods

- Explain why threadpool is used (blocking file I/O needs to be non-blocking)
- Clarify this maintains event loop concurrency
- Remove misleading implication that all async operations use threadpool
- Connect to the broader async/await philosophy of FastAPI
pull/15696/head
Achyuta Dixit 1 month ago
committed by GitHub
parent
commit
70fed2844e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      docs/en/docs/tutorial/request-files.md

2
docs/en/docs/tutorial/request-files.md

@ -99,7 +99,7 @@ contents = myfile.file.read()
/// note | `async` Technical Details /// note | `async` Technical Details
When you use the `async` methods, **FastAPI** runs the file methods in a threadpool and awaits for them. The `UploadFile` async methods wrap blocking file I/O operations and run them in a threadpool to make them non-blocking. This allows the async event loop to process other requests while file operations are in progress, which is essential for maintaining the non-blocking nature of your `async def` path operation functions.
/// ///

Loading…
Cancel
Save