Class: Bellbro::SidekiqUtils::Queue

Inherits:
Object
  • Object
show all
Defined in:
lib/bellbro/sidekiq_utils.rb

Class Method Summary collapse

Class Method Details

.allObject



11
12
13
14
15
# File 'lib/bellbro/sidekiq_utils.rb', line 11

def self.all
  names.map do |name|
    Sidekiq::Queue.new(name)
  end
end

.clear_allObject



23
24
25
26
27
# File 'lib/bellbro/sidekiq_utils.rb', line 23

def self.clear_all
  each do |q|
    q.clear
  end
end

.eachObject



17
18
19
20
21
# File 'lib/bellbro/sidekiq_utils.rb', line 17

def self.each
  names.each do |name|
    yield Sidekiq::Queue.new(name)
  end
end

.namesObject



7
8
9
# File 'lib/bellbro/sidekiq_utils.rb', line 7

def self.names
  Sidekiq::Stats::Queues.new.lengths.keys
end