Class: Fractor::Workflow::PipelineExecutionStrategy

Inherits:
SequentialExecutionStrategy show all
Defined in:
lib/fractor/workflow/execution_strategy.rb

Overview

Strategy for executing jobs as a pipeline. Jobs are executed sequentially with data flowing from one to the next.

Instance Attribute Summary

Attributes inherited from ExecutionStrategy

#debug, #executor

Instance Method Summary collapse

Methods inherited from ExecutionStrategy

#initialize, #should_execute_job?

Constructor Details

This class inherits a constructor from Fractor::Workflow::ExecutionStrategy

Instance Method Details

#execute(job_group) ⇒ Boolean

Execute a group of jobs as a pipeline.

Parameters:

  • job_group (Array<Job>)

    Jobs to execute (must be exactly 1 for pipeline)

Returns:

  • (Boolean)

    true if execution should continue



213
214
215
216
217
218
219
220
221
222
# File 'lib/fractor/workflow/execution_strategy.rb', line 213

def execute(job_group)
  if job_group.size > 1
    raise WorkflowError,
          "Pipeline strategy expects exactly 1 job per group, got #{job_group.size}"
  end

  log_debug "Executing pipeline job: #{job_group.first.name}"

  super
end