Skip to main content

Module queue

Module queue 

Source
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 pending with incremented attempt.

Structs§

ClaimRequest
Parameters for claiming tasks from the queue.
ConcurrencyConfig
Concurrency configuration for backpressure (Section 10.3).
QueueEntry
A single entry in the task queue.
QueueStats
Summary statistics for the queue.

Enums§

QueueStatus
Status of a queue entry.

Traits§

TaskQueue
Abstract task queue. Implementations must be thread-safe.