Chapter 6 of 6
Blocking calls on the event loop
A synchronous 800ms PDF extraction inside an async handler freezes every other request sharing that worker, including ones that were a millisecond from returning, which is why the p99 damage lands hardest on endpoints that never touch a PDF. This chapter covers the one measurement that proves it — a no-op scheduled every 100ms, recorded by how late it fires — what asyncio.to_thread recovers, and where a thread stops being enough.
Async and concurrency in Python — read the current version at https://daviddominguez.dev/learn/en/async-and-concurrency-in-python/blocking-calls-on-the-event-loop