bartender.web.lifespan#

Attributes#

Functions#

lifespan(→ AsyncGenerator[None, None])

Logic which runs on application's startup and shutdown.

startup(→ None)

Logic which runs on application's startup.

shutdown(→ None)

Logic which runs on application's shutdown.

_setup_db(→ None)

Creates connection to the database.

_parse_context(→ None)

Parse configuration and instantiate applications, schedulers and filesystems.

setup_jwt_decoder(→ None)

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

bartender.web.lifespan._parse_context(app: fastapi.FastAPI) None#

Parse configuration and instantiate applications, schedulers and filesystems.

Sets app.state.config and app.state.context.

Parameters:

app (fastapi.FastAPI) – fastAPI application.

Return type:

None

bartender.web.lifespan.setup_jwt_decoder(app: fastapi.FastAPI) None#

Setup JWT token decoder.

Parameters:

app (fastapi.FastAPI) – fastAPI application.

Return type:

None