Class: Sidekiq::Pauzer::Repository
- Inherits:
-
Object
- Object
- Sidekiq::Pauzer::Repository
- Includes:
- Enumerable
- Defined in:
- lib/sidekiq/pauzer/repository.rb
Constant Summary collapse
- REDIS_KEY =
"sidekiq-pauzer"
Instance Method Summary collapse
Instance Method Details
#add(queue_name) ⇒ void
This method returns an undefined value.
27 28 29 30 |
# File 'lib/sidekiq/pauzer/repository.rb', line 27 def add(queue_name) redis_call("SADD", REDIS_KEY, queue_name.to_s) nil end |
#delete(queue_name) ⇒ void
This method returns an undefined value.
34 35 36 37 |
# File 'lib/sidekiq/pauzer/repository.rb', line 34 def delete(queue_name) redis_call("SREM", REDIS_KEY, queue_name.to_s) nil end |
#each ⇒ Enumerator<String> #each {|queue_name| ... } ⇒ self
17 18 19 20 21 22 23 |
# File 'lib/sidekiq/pauzer/repository.rb', line 17 def each return to_enum __method__ unless block_given? redis_call("SMEMBERS", REDIS_KEY).each { yield _1.freeze } self end |
#include?(queue_name) ⇒ void
This method returns an undefined value.
41 42 43 |
# File 'lib/sidekiq/pauzer/repository.rb', line 41 def include?(queue_name) redis_call("SISMEMBER", REDIS_KEY, queue_name.to_s).positive? end |