Module realm_api.app

FastAPI application

Global variables

var app

Web application

Functions

async def lifespan(app: fastapi.applications.FastAPI)
Expand source code
@asynccontextmanager
async def lifespan(app: FastAPI):
    """Lifespan function: startup -> yield -> shutdown"""

    await init_db()
    task = await init_pubsub()
    yield
    await shutdown_pubsub(task)

Lifespan function: startup -> yield -> shutdown