Class: Sidekiq::Sequence::Base
- Inherits:
-
Object
- Object
- Sidekiq::Sequence::Base
- Defined in:
- lib/sidekiq/sequence/base.rb
Class Attribute Summary collapse
-
.steps ⇒ Object
readonly
Returns the value of attribute steps.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
Class Attribute Details
.steps ⇒ Object (readonly)
Returns the value of attribute steps.
7 8 9 |
# File 'lib/sidekiq/sequence/base.rb', line 7 def steps @steps end |
Class Method Details
.perform_step(index, id) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/sidekiq/sequence/base.rb', line 15 def self.perform_step(index, id) if index >= steps.size # No more steps in the sequence, so delete the record. Record.destroy id else steps[index].constantize.perform_async id end end |
.step(worker_class) ⇒ Object
9 10 11 12 |
# File 'lib/sidekiq/sequence/base.rb', line 9 def step(worker_class) @steps = [] if steps.nil? @steps << worker_class.name end |