{# app/backend/extensions/events.py — startup/shutdown event handlers #}
"""Startup and shutdown event handlers for {{ project_name }}.

Add custom lifespan events here. These will be discovered
automatically by the composition root.

Example::

    async def on_startup():
        print("App is starting up")

    async def on_shutdown():
        print("App is shutting down")
"""

from collections.abc import AsyncGenerator
from contextlib import asynccontextmanager

from fastapi import FastAPI


@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncGenerator[None]:
    """Custom lifespan events. Extend as needed."""
    # Startup
    yield
    # Shutdown
