events
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
async def on_shutdown() -> None:
pass
app = Litestar(
route_handlers=[],
on_startup=[on_startup],
on_shutdown=[on_shutdown],
)
Event Checklist
- Fail fast on critical startup failures.
- Ensure shutdown paths release external resources.
- Avoid long blocking tasks in lifecycle hooks.
Litestar References
Weekly Installs
1
Repository
alti3/litestar-skillsGitHub Stars
5
First Seen
14 days ago
Security Audits
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1