Sha256: 3df5bbe4b7de01d613e9983f1cd03f73f4e9497a751da927649a89982252c6de

Contents?: true

Size: 789 Bytes

Versions: 3

Compression:

Stored size: 789 Bytes

Contents

# encoding: utf-8

module HireFire
  module Backend
    module Resque
      module Redis

        ##
        # 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
        #
        # @return [Fixnum]
        def jobs
          ::Resque.info[:pending].to_i
        end

        ##
        # Counts the amount of workers
        #
        # @return [Fixnum]
        def workers
          ::Resque.info[:workers].to_i
        end

        ##
        # Counts the amount of jobs that are being processed by workers
        #
        # @return [Fixnum]
        def working
          ::Resque.info[:working].to_i
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hirefire-0.1.4 lib/hirefire/backend/resque/redis.rb
hirefire-0.1.3 lib/hirefire/backend/resque/redis.rb
hirefire-0.1.2 lib/hirefire/backend/resque/redis.rb