Iii iii-queue-processing
install
source · Clone the upstream repo
git clone https://github.com/iii-hq/iii
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/iii-hq/iii "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/iii-queue-processing" ~/.claude/skills/iii-hq-iii-iii-queue-processing && rm -rf "$T"
manifest:
skills/iii-queue-processing/SKILL.mdsource content
Queue Processing
Comparable to: BullMQ, Celery, SQS
Key Concepts
Use the concepts below when they fit the task. Not every queue setup needs all of them.
- Named queues are declared in
underiii-config.yamlqueue_configs - Standard queues process jobs concurrently; FIFO queues preserve ordering
dispatches a job to a named queueTriggerAction.Enqueue({ queue })- Failed jobs auto-retry with exponential backoff up to
max_retries - Jobs that exhaust retries land in a dead letter queue for inspection
- Each consumer function receives the job payload and a
messageReceiptId - Fan-out is achieved by having one producer trigger multiple distinct consumer functions via separate enqueue calls
Architecture
Producer function → TriggerAction.Enqueue({ queue: 'task-queue' }) → Named Queue (standard or FIFO) → Consumer registerFunction handler → success / retry with backoff → Dead Letter Queue (after max_retries)
iii Primitives Used
| Primitive | Purpose |
|---|---|
| Define the consumer that processes jobs |
| Dispatch a job to a named queue |
| Acknowledge or track individual job processing |
in | Declare queues with concurrency and retries |
Reference Implementation
See ../references/queue-processing.js for the full working example — a producer that enqueues jobs and a consumer that processes them with retry logic.
Also available in Python: ../references/queue-processing.py
Also available in Rust: ../references/queue-processing.rs
Common Patterns
Code using this pattern commonly includes, when relevant:
— worker initializationregisterWorker(url, { workerName })
— define the consumerregisterFunction(id, handler)
— enqueue a jobtrigger({ function_id, payload, action: TriggerAction.Enqueue({ queue }) })
— track or acknowledge the jobpayload.messageReceiptId
— persist results after processingtrigger({ function_id: 'state::set', payload })
— structured logging per jobconst logger = new Logger()
Adapting This Pattern
Use the adaptations below when they apply to the task.
- Choose FIFO queues when job ordering matters (e.g. sequential pipeline steps)
- Set
andmax_retries
in queue config to match your workloadconcurrency - Chain multiple queues for multi-stage pipelines (queue A consumer enqueues to queue B)
- For idempotency, check state before processing to avoid duplicate work on retries
- Use fan-out by enqueuing to multiple consumer functions when a single event requires parallel processing (e.g. payment + notification + audit)
Engine Configuration
Named queues are declared in iii-config.yaml under
queue_configs with per-queue max_retries, concurrency, type, and backoff_ms. Fan-out is a pattern (one producer triggers multiple consumer functions), not a queue config key. See ../references/iii-config.yaml for the full annotated config reference.
Pattern Boundaries
- If the task only needs fire-and-forget without retries or ordering, prefer
withiii-trigger-actions
.TriggerAction.Void() - If failed jobs need special handling or alerting, prefer
for the DLQ consumer.iii-dead-letter-queues - If the task is step-by-step orchestration with branching, prefer
.iii-workflow-orchestration - Stay with
when the primary need is reliable async job execution with retries.iii-queue-processing
When to Use
- Use this skill when the task is primarily about
in the iii engine.iii-queue-processing - Triggers when the request directly asks for this pattern or an equivalent implementation.
Boundaries
- Never use this skill as a generic fallback for unrelated tasks.
- You must not apply this skill when a more specific iii skill is a better fit.
- Always verify environment and safety constraints before applying examples from this skill.