Sha256: fe37dede8426d9eee5e61f21ffee58ac40fcd094659fdc51c2b1ba2db7d0a8b2

Contents?: true

Size: 1.1 KB

Versions: 71

Compression:

Stored size: 1.1 KB

Contents

module Resque
  module Failure
    # A Failure backend that uses multiple backends
    # delegates all queries to the first backend
    class Multiple < Base

      class << self
        attr_accessor :classes
      end

      def self.configure
        yield self
        Resque::Failure.backend = self
      end

      def initialize(*args)
        super
        @backends = self.class.classes.map {|klass| klass.new(*args)}
      end

      def save
        @backends.each(&:save)
      end

      # The number of failures.
      def self.count
        classes.first.count
      end

      # Returns a paginated array of failure objects.
      def self.all(start = 0, count = 1)
        classes.first.all(start,count)
      end

      # A URL where someone can go to view failures.
      def self.url
        classes.first.url
      end

      # Clear all failure objects
      def self.clear
        classes.first.clear
      end

      def self.requeue(*args)
        classes.first.requeue(*args)
      end

      def self.remove(index)
        classes.each { |klass| klass.remove(index) }
      end
    end
  end
end

Version data entries

71 entries across 71 versions & 7 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.7.4 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.7.3 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.7.2 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.7.1 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.7.0 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.6.9 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.6.8 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.6.7 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.6.6 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.6.5 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.6.4 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.6.3 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.6.2 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.6.1 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.6.0 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
resque-1.23.0 lib/resque/failure/multiple.rb
classiccms-0.5.17 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.5.16 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb
classiccms-0.5.15 vendor/bundle/gems/resque-1.20.0/lib/resque/failure/multiple.rb