Class: DirtyPipeline::Worker
- Inherits:
-
Object
- Object
- DirtyPipeline::Worker
- Includes:
- Sidekiq::Worker
- Defined in:
- lib/dirty_pipeline/worker.rb
Instance Method Summary collapse
-
#perform(options = {}) ⇒ Object
args should contain - “enqueued_pipeline” args should contain - some args to find_subject args should contain - some args to make transition.
Instance Method Details
#perform(options = {}) ⇒ Object
args should contain - “enqueued_pipeline” args should contain - some args to find_subject args should contain - some args to make transition
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/dirty_pipeline/worker.rb', line 11 def perform( = {}) pipeline_klass = Kernel.const_get(.fetch("enqueued_pipeline").to_s.camelcase) subject = pipeline_klass.find_subject(*.fetch("find_subject_args")) transaction_id = .fetch("transaction_id") pipeline = pipeline_klass.new(subject, uuid: transaction_id) operation = .fetch("operation") case operation when "cleanup" return pipeline.clean when "retry" return pipeline.retry end pipeline.call end |