litestar-saq
Installation
SKILL.md
litestar-saq
litestar-saq is the first-party plugin that integrates SAQ (Simple Async Queue) with Litestar. It provides:
SAQPlugin— registers queues, workers, lifespan management, and DI forTaskQueuesSAQConfig/QueueConfig— declarative queue + worker configurationlitestar workers run— CLI to start workers in-process or as a separate process- Optional web UI mounted under the Litestar app
- DI injection of
TaskQueuesinto route handlers for ergonomic enqueueing
Code Style Rules
- Use PEP 604 unions:
T | None, neverOptional[T] - Consumer Litestar app modules MAY use
from __future__ import annotations— canonical Litestar apps do. - Async all I/O — task bodies and enqueue calls are
async def. - First positional arg of every task is
ctx: dict(the SAQ context dict). - Task params after
*are keyword-only.