Sha256: bb4cc89e80b313c0ae9772c24390366da8574f94cd58eea4ab541a21edac7957

Contents?: true

Size: 1.42 KB

Versions: 86

Compression:

Stored size: 1.42 KB

Contents

module Resque
  module Failure
    # All Failure classes are expected to subclass Base.
    #
    # When a job fails, a new instance of your Failure backend is created
    # and #save is called.
    class Base
      # The exception object raised by the failed job
      attr_accessor :exception

      # The worker object who detected the failure
      attr_accessor :worker

      # The string name of the queue from which the failed job was pulled
      attr_accessor :queue

      # The payload object associated with the failed job
      attr_accessor :payload

      def initialize(exception, worker, queue, payload)
        @exception = exception
        @worker    = worker
        @queue     = queue
        @payload   = payload
      end

      # When a job fails, a new instance of your Failure backend is created
      # and #save is called.
      #
      # This is where you POST or PUT or whatever to your Failure service.
      def save
      end

      # The number of failures.
      def self.count
        0
      end

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

      # A URL where someone can go to view failures.
      def self.url
      end
      
      # Clear all failure objects
      def self.clear
      end
      
      def self.requeue(index)
      end

      # Logging!
      def log(message)
        @worker.log(message)
      end
    end
  end
end

Version data entries

86 entries across 86 versions & 5 rubygems

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