Class: Honcho::Adapters::Resque
- Defined in:
- lib/honcho/adapters/resque.rb
Instance Attribute Summary
Attributes inherited from Base
#config, #redis, #runner, #running, #stopping
Instance Method Summary collapse
Methods inherited from Base
#check_for_work, #commands, #initialize, #name, #path, #really_stop, #run?, #running?, #should_stop?, #start, #start_command, #stop, #stopping?, #total_count, #type
Constructor Details
This class inherits a constructor from Honcho::Adapters::Base
Instance Method Details
#busy_count ⇒ Object
10 11 12 13 |
# File 'lib/honcho/adapters/resque.rb', line 10 def busy_count # No way to tell via redis if work is being done in resque? Booo. 0 end |
#namespace ⇒ Object
15 16 17 |
# File 'lib/honcho/adapters/resque.rb', line 15 def namespace config.fetch('namespace') end |
#queued_count ⇒ Object
4 5 6 7 8 |
# File 'lib/honcho/adapters/resque.rb', line 4 def queued_count queues = redis.smembers("#{namespace}:queues") counts = queues.map { |q| redis.llen("#{namespace}:queue:#{q}") } counts.inject(&:+) || 0 end |