Class: Resque::Failure::Multiple
- Defined in:
- lib/resque/failure/multiple.rb
Overview
A Failure backend that uses multiple backends delegates all queries to the first backend
Class Attribute Summary collapse
-
.classes ⇒ Object
Returns the value of attribute classes.
Attributes inherited from Base
#exception, #payload, #queue, #worker
Class Method Summary collapse
-
.all(start = 0, count = 1) ⇒ Object
Returns a paginated array of failure objects.
-
.clear ⇒ Object
Clear all failure objects.
- .configure {|_self| ... } ⇒ Object
-
.count ⇒ Object
The number of failures.
- .requeue(*args) ⇒ Object
-
.url ⇒ Object
A URL where someone can go to view failures.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Multiple
constructor
A new instance of Multiple.
- #save ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(*args) ⇒ Multiple
Returns a new instance of Multiple.
16 17 18 |
# File 'lib/resque/failure/multiple.rb', line 16 def initialize(*args) @backends = self.class.classes.map {|klass| klass.new(*args)} end |
Class Attribute Details
.classes ⇒ Object
Returns the value of attribute classes.
8 9 10 |
# File 'lib/resque/failure/multiple.rb', line 8 def classes @classes end |
Class Method Details
.all(start = 0, count = 1) ⇒ Object
Returns a paginated array of failure objects.
29 30 31 |
# File 'lib/resque/failure/multiple.rb', line 29 def self.all(start = 0, count = 1) classes.first.all(start,count) end |
.clear ⇒ Object
Clear all failure objects
39 40 41 |
# File 'lib/resque/failure/multiple.rb', line 39 def self.clear classes.first.clear end |
.configure {|_self| ... } ⇒ Object
11 12 13 14 |
# File 'lib/resque/failure/multiple.rb', line 11 def self.configure yield self Resque::Failure.backend = self end |
.count ⇒ Object
The number of failures.
24 25 26 |
# File 'lib/resque/failure/multiple.rb', line 24 def self.count classes.first.count end |
.requeue(*args) ⇒ Object
43 44 45 |
# File 'lib/resque/failure/multiple.rb', line 43 def self.requeue(*args) classes.first.requeue(*args) end |
.url ⇒ Object
A URL where someone can go to view failures.
34 35 36 |
# File 'lib/resque/failure/multiple.rb', line 34 def self.url classes.first.url end |
Instance Method Details
#save ⇒ Object
19 20 21 |
# File 'lib/resque/failure/multiple.rb', line 19 def save @backends.each(&:save) end |