Living Document Notice
Staged 2026-09-27. Living revisions and interconnected notes live in the Stax Digital Garden.
Asynchronous Task Queues and Worker Heartbeat Monitoring
Managing distributed background tasks across local containers requires reliable heartbeat tracking to detect stalled processes and dropped connections. Lightweight SQLite-backed task queues provide durable state persistence without external daemon dependencies.
Queue Invariants
- Lease-Based Worker Locking: Tasks lock against specific worker IDs with strict lease expiration timers, preventing duplicate execution.
- Append-Only Event Streams: Every task state transition (queued, running, completed, failed) writes an immutable event record to the local log.
- Automatic Dead-Letter Routing: Unresponsive worker tasks automatically migrate to quarantine queues for manual operator inspection.
Durable local task queues eliminate dropped jobs and ensure background operations run with absolute reliability.
- Directus Target: yeoman-blog
- Garden Source Reference: MOC - Yeoman Agent Supervision, MOC - Bosun PKM Engine, TRC-1001 - 5-State Checkbox AST Spec