INNER CODE UNIT · Python

LifecycleComponent

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

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


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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…