Module: Wurk::Keys

Defined in:
lib/wurk/keys.rb

Overview

Canonical Redis key constants. Wire-compat is sacred: these strings are the on-disk schema shared with Sidekiq OSS and every third-party gem that reads Redis directly (sidekiq-cron, sidekiq-unique-jobs, etc.). Renaming or namespacing any of them silently breaks the drop-in contract.

OSS uses no namespace. Pro/Ent layer a prefix on top; that lives outside the free gem.

Spec: docs/target/sidekiq-free.md §1 (Redis Key Schema).

Constant Summary collapse

QUEUE_PREFIX =

Queue list keys: ‘queue:<name>` (LIST, LPUSH/BRPOP).

'queue:'
QUEUES_SET =

Set of known queue names, without the ‘queue:` prefix.

'queues'
PAUSED_SET =

Set of paused queue names (Pro feature; Wurk ships it free). Members are unprefixed queue names. Fetchers exclude these on each pass.

'paused'
SCHEDULE =

Sorted sets keyed by score = unix epoch float seconds.

'schedule'
RETRY =
'retry'
DEAD =
'dead'
PROCESSES =

Live process identities (heartbeat membership).

'processes'
STAT_PROCESSED =

Global processed counter; per-day variants append ‘:YYYY-MM-DD`.

'stat:processed'
STAT_EXPIRED =

Global expired counter — subset of processed: jobs the Expiry server middleware dropped before ‘perform` because `expiry` had already elapsed. Per-day variants append `:YYYY-MM-DD`. Spec: sidekiq-pro.md §7.

'stat:expired'
STATS_TTL =

TTL applied to per-day ‘stat:processed:*` / `stat:failed:*` / `stat:expired:*` strings. 5 years, in seconds. Matches Sidekiq::Launcher::STATS_TTL.

5 * 365 * 24 * 60 * 60

Class Method Summary collapse

Class Method Details

.queue(name) ⇒ Object

Build a queue list key from a queue name. Centralizing the concat keeps the prefix in one place even though it’s a constant — third-party gems that grep for ‘“queue:”` still find it via the constant.



48
49
50
# File 'lib/wurk/keys.rb', line 48

def self.queue(name)
  "#{QUEUE_PREFIX}#{name}"
end