Class: Honcho::Adapters::Resque

Inherits:
Base
  • Object
show all
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_countObject



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

#namespaceObject



15
16
17
# File 'lib/honcho/adapters/resque.rb', line 15

def namespace
  config.fetch('namespace')
end

#queued_countObject



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