Class: MedPipe::PipelinePlanConsumer
- Inherits:
-
Object
- Object
- MedPipe::PipelinePlanConsumer
- Defined in:
- lib/med_pipe/pipeline_plan_consumer.rb
Overview
enqueued な pipeline plan を1つ取得 & 実行
Instance Method Summary collapse
-
#initialize(pipeline_group:, pipeline_runner:) ⇒ PipelinePlanConsumer
constructor
A new instance of PipelinePlanConsumer.
-
#run ⇒ PipelinePlan
実行した pipeline plan。なければ nil.
Constructor Details
#initialize(pipeline_group:, pipeline_runner:) ⇒ PipelinePlanConsumer
Returns a new instance of PipelinePlanConsumer.
6 7 8 9 |
# File 'lib/med_pipe/pipeline_plan_consumer.rb', line 6 def initialize(pipeline_group:, pipeline_runner:) @pipeline_group = pipeline_group @pipeline_runner = pipeline_runner end |
Instance Method Details
#run ⇒ PipelinePlan
Returns 実行した pipeline plan。なければ nil.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/med_pipe/pipeline_plan_consumer.rb', line 12 def run pipeline_plan = fetch_and_run_pipeline_plan return nil if pipeline_plan.nil? @pipeline_runner.call(pipeline_plan) complete_pipeline_plan(pipeline_plan) pipeline_plan rescue StandardError => e error_pipeline_plan(pipeline_plan) raise e end |