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'- HISTORY_METRICS =
Ent Historical Metrics: capped Redis stream of periodic snapshots written by Wurk::History (§5.3). Same key a migrated Sidekiq Ent install uses, so its existing data renders without rewrite. Spec: sidekiq-ent.md §5.3, §10.
'history:metrics'- PROFILES =
Profiles (v8.0+): ZSET of
<token>-<jid>keys, score = expiry epoch; each member also has a<token>-<jid>HASH holding the profile blob. Spec: docs/target/sidekiq-free.md §1.7. 'profiles'- 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
performbecauseexpiryhad 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
-
.queue(name) ⇒ Object
Build a queue list key from a queue name.
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.
58 59 60 |
# File 'lib/wurk/keys.rb', line 58 def self.queue(name) "#{QUEUE_PREFIX}#{name}" end |