async and await in FastAPI
Use async endpoints when the work awaits non-blocking I O; sync endpoints are fine for CPU work or blocking libraries.
- Async improves concurrency for waits
- Do not block the event loop
- Choose library support carefully
async and await in FastAPI