bartender.web.lifespan#
Attributes#
Functions#
|
Logic which runs on application's startup and shutdown. |
|
Logic which runs on application's startup. |
|
Logic which runs on application's shutdown. |
|
Creates connection to the database. |
|
Parse configuration and instantiate applications, schedulers and filesystems. |
|
Setup JWT token decoder. |
Module Contents#
- bartender.web.lifespan.logger#
- async bartender.web.lifespan.lifespan(app: fastapi.FastAPI) AsyncGenerator[None, None]#
Logic which runs on application’s startup and shutdown.
- Parameters:
app (fastapi.FastAPI) – fastAPI application.
- Yields:
Nothing.
- Return type:
AsyncGenerator[None, None]
- bartender.web.lifespan.startup(app: fastapi.FastAPI) None#
Logic which runs on application’s startup.
- Parameters:
app (fastapi.FastAPI) – The FastAPI application instance.
- Return type:
None
- async bartender.web.lifespan.shutdown(app: fastapi.FastAPI) None#
Logic which runs on application’s shutdown.
- Parameters:
app (fastapi.FastAPI) – fastAPI application.
- Return type:
None
- bartender.web.lifespan._setup_db(app: fastapi.FastAPI) None#
Creates connection to the database.
This function creates SQLAlchemy engine instance, session_factory for creating sessions and stores them in the application’s state property.
- Parameters:
app (fastapi.FastAPI) – fastAPI application.
- Return type:
None