FastAPI awaits async def handlers directly on the main asyncio event loop, while plain def handlers are offloaded to AnyIO’s worker threadpool so they don’t freeze the loop. Calling synchronous I/O like requests.get() or time.sleep() inside async def blocks the entire event loop for every concurrent request; use httpx.AsyncClient or asyncio.to_thread.
Follow-up Interview Question · When might an async def endpoint with heavy CPU JSON parsing still degrade tail latency?