Glossary: Building APIs with FastAPI
asynccontextmanager
A decorator from `contextlib` that turns an async generator into a context manager. FastAPI uses one for the lifespan function, which sets up before `yield` and cleans up after.
Glossary: Building APIs with FastAPI
A decorator from `contextlib` that turns an async generator into a context manager. FastAPI uses one for the lifespan function, which sets up before `yield` and cleans up after.