Module: HireFire::Backend::Resque::Redis

Defined in:
lib/hirefire/backend/resque/redis.rb

Instance Method Summary collapse

Instance Method Details

#jobsFixnum

Counts the amount of pending jobs in Redis

Failed jobs are excluded because they are not listed as “pending” and jobs cannot be scheduled for the future in Resque

Returns:

  • (Fixnum)


15
16
17
# File 'lib/hirefire/backend/resque/redis.rb', line 15

def jobs
  ::Resque.info[:pending].to_i
end

#workersFixnum

Counts the amount of workers

Returns:

  • (Fixnum)


23
24
25
# File 'lib/hirefire/backend/resque/redis.rb', line 23

def workers
  ::Resque.info[:workers].to_i
end

#workingFixnum

Counts the amount of jobs that are being processed by workers

Returns:

  • (Fixnum)


31
32
33
# File 'lib/hirefire/backend/resque/redis.rb', line 31

def working
  ::Resque.info[:working].to_i
end