Expand description
TaskQueue trait — abstraction over lease-based task scheduling.
The queue implements FOR UPDATE SKIP LOCKED-style claim semantics
(Section 9.3): tasks are enqueued with priority and availability time,
claimed with a lease TTL, and must be heartbeated to prevent reclamation.
Lease semantics (Section 10.2):
- Worker lease TTL: default 30s (configurable).
- Heartbeat every 5s while task executes.
- Scheduler reclaims stale leases after TTL + grace window.
- Reclaimed tasks move back to
pendingwith incremented attempt.
Structs§
- Claim
Request - Parameters for claiming tasks from the queue.
- Concurrency
Config - Concurrency configuration for backpressure (Section 10.3).
- Queue
Entry - A single entry in the task queue.
- Queue
Stats - Summary statistics for the queue.
Enums§
- Queue
Status - Status of a queue entry.
Traits§
- Task
Queue - Abstract task queue. Implementations must be thread-safe.