Skip to content

Glossary: Building APIs with FastAPI

Blocking call

Also written: blocking, blocks the event loop

Code that makes the program wait without letting anything else run, such as `time.sleep`, `requests.get`, `sqlite3` or a SQLModel session. Inside an `async def` endpoint it freezes the whole server, so use `def` for such code.

Where the book teaches it

Related terms

async defEvent loopThread pool