events
Installation
SKILL.md
Events
Use this skill when code must run during application startup/shutdown or when lifecycle orchestration is needed.
Workflow
- Register startup hooks for shared resources (DB pools, clients, caches).
- Register shutdown hooks for cleanup.
- Keep hooks idempotent and failure-aware.
- Use app state/dependencies to expose initialized resources.
Pattern
from litestar import Litestar
async def on_startup() -> None:
pass