Class: SidekiqUniqueJobs::Key
- Inherits:
-
Object
- Object
- SidekiqUniqueJobs::Key
- Defined in:
- lib/sidekiq_unique_jobs/key.rb
Overview
Key class wraps logic dealing with various lock keys
Instance Attribute Summary collapse
-
#digest ⇒ Object
readonly
Returns the value of attribute digest.
-
#digests ⇒ Object
readonly
Returns the value of attribute digests.
-
#locked ⇒ Object
readonly
Returns the value of attribute locked.
Class Method Summary collapse
-
.heartbeat(identity) ⇒ String
Returns the heartbeat key for a process.
-
.working(identity) ⇒ String
Returns the per-process working list key.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(digest) ⇒ Key
constructor
Initialize a new Key.
- #inspect ⇒ Object
-
#to_a ⇒ Array<String>
Returns keys for Lua scripts: [locked, digests].
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#digest ⇒ Object (readonly)
Returns the value of attribute digest.
11 12 13 |
# File 'lib/sidekiq_unique_jobs/key.rb', line 11 def digest @digest end |
#digests ⇒ Object (readonly)
Returns the value of attribute digests.
19 20 21 |
# File 'lib/sidekiq_unique_jobs/key.rb', line 19 def digests @digests end |
#locked ⇒ Object (readonly)
Returns the value of attribute locked.
15 16 17 |
# File 'lib/sidekiq_unique_jobs/key.rb', line 15 def locked @locked end |
Class Method Details
.heartbeat(identity) ⇒ String
Returns the heartbeat key for a process
50 51 52 |
# File 'lib/sidekiq_unique_jobs/key.rb', line 50 def self.heartbeat(identity) "uniquejobs:heartbeat:#{identity}" end |
.working(identity) ⇒ String
Returns the per-process working list key
39 40 41 |
# File 'lib/sidekiq_unique_jobs/key.rb', line 39 def self.working(identity) "uniquejobs:working:#{identity}" end |
Instance Method Details
#==(other) ⇒ Object
62 63 64 |
# File 'lib/sidekiq_unique_jobs/key.rb', line 62 def ==(other) digest == other.digest end |
#inspect ⇒ Object
58 59 60 |
# File 'lib/sidekiq_unique_jobs/key.rb', line 58 def inspect digest end |
#to_a ⇒ Array<String>
Returns keys for Lua scripts: [locked, digests]
71 72 73 |
# File 'lib/sidekiq_unique_jobs/key.rb', line 71 def to_a [locked, digests] end |
#to_s ⇒ Object
54 55 56 |
# File 'lib/sidekiq_unique_jobs/key.rb', line 54 def to_s digest end |