INNER CODE UNIT · Python

ShutdownComponent

CaddyGlow/ccproxy-api · ccproxy/api/app.py:93

class ShutdownComponent(TypedDict):
    name: str
    shutdown: Callable[[FastAPI], Awaitable[None]] | None


async def setup_task_manager_startup(app: FastAPI, settings: Settings) -> None:
    """Start the async task manager."""
    container: ServiceContainer = app.state.service_container
    await start_task_manager(container=container)
    logger.debug("task_manager_startup_completed", category="lifecycle")


async def setup_task_manager_shutdown(app: FastAPI) -> None:
    """Stop the async task manager."""
    container: ServiceContainer = app.state.service_container
    await stop_task_manager(container=container)
    logger.debug("task_manager_shutdown_completed", category="lifecycle")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…