Optionaloptions: RedisQueueOptions
Connection, client and retention options
OptionalclaimRenewed lease, present only while connected to an eval-capable client.
OptionaldepthsM70k (X8-4): counts this name's three states with one ZCARD each.
Absent on a client that does not expose zcard, which is why the member is
an assigned property rather than a declared method — the health indicator
must be able to tell "cannot report" from "nothing there". Absent again
after disconnect, for the same reason isHealthy is: the closure
captures the client it was installed for, so leaving it in place would
answer a depth read with that dead client's rejection instead of the
absence that says the adapter cannot count right now.
Job name
The depth of each state
OptionalisM70c: present only when the client exposes ping(); its absence is
unknown reachability, not false (a minimal injected fake has not told
us the server is dead).
Acknowledges a job as successfully processed.
Job name
Job ID (stable public identity)
OptionalclaimToken: string
Opaque claim token returned from reserve (prevents stale settlement)
Resolves when acknowledged
Moves a job to the dead letter queue.
Job name
Job ID (stable public identity)
Current timestamp in ms (for dead-letter timestamp)
OptionalclaimToken: string
Opaque claim token returned from reserve (prevents stale settlement)
Resolves when dead-lettered
Enqueues a job.
The job to enqueue
Resolves when enqueued
Requeues a job with a new available timestamp.
Job name
Job ID (stable public identity)
When the job becomes available again
Updated attempt count
OptionalclaimToken: string
Opaque claim token returned from reserve (prevents stale settlement)
Resolves when requeued
Reserves up to limit due jobs. Redis scripts use server time; adapters
without a server clock compare availableAtMs to nowMs.
CLAIMS jobs: moves them from ready set to processing set. A reserved job is not returned by subsequent reserve calls.
Job name
Maximum jobs to reserve
Caller timestamp in ms, used when there is no server clock
The reserved jobs
Redis queue adapter implementation.
Uses Redis sorted sets (ZSET) for ready/processing/dead sets and hashes (HASH) for job payloads. Implements the claim-based reserve pattern to prevent double-dispatch.
Key structure per job name:
queue:<name>:ready- ZSET (score = availableAtMs, member = jobId)queue:<name>:processing- ZSET (score = lease deadline on the Redis clock)queue:<name>:claims/stalls- HASH (delivery tokens / abandoned attempts)queue:<name>:claimseq- persistent INCR sequence shared across replicasqueue:<name>:dead- ZSET (score = deadLetterAtMs, member = jobId)queue:<name>:jobs- HASH (field = jobId, value = JSON job)queue:<name>:dead:jobs- HASH (dead payloads; only when a TTL is configured)Recurring jobs:
queue:recurring:due- ZSET (score = nextRunAtMs, member = recurringId)queue:recurring:jobs- HASH (field = recurringId, value = JSON recurring)Since
0.1.0