Class: Docket::RoundRobin
- Inherits:
-
Object
- Object
- Docket::RoundRobin
- Defined in:
- lib/docket/round_robin.rb
Instance Attribute Summary collapse
-
#storage ⇒ Object
Returns the value of attribute storage.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ RoundRobin
constructor
A new instance of RoundRobin.
- #perform(identifier, action) ⇒ Object
- #set(identifier, robins, options = {}) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ RoundRobin
Returns a new instance of RoundRobin.
6 7 8 |
# File 'lib/docket/round_robin.rb', line 6 def initialize args={} @storage = args[:storage] || Docket::Storage.new('/tmp/docket.rb') end |
Instance Attribute Details
#storage ⇒ Object
Returns the value of attribute storage.
4 5 6 |
# File 'lib/docket/round_robin.rb', line 4 def storage @storage end |
Instance Method Details
#perform(identifier, action) ⇒ Object
14 15 16 17 |
# File 'lib/docket/round_robin.rb', line 14 def perform identifier, action robin = _next_robin identifier action.call(robin) end |
#set(identifier, robins, options = {}) ⇒ Object
10 11 12 |
# File 'lib/docket/round_robin.rb', line 10 def set identifier, robins, ={} _set identifier, robins, end |