Class: Fractor::Workflow::SequentialExecutionStrategy

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

Overview

Strategy for executing jobs sequentially, one after another. Jobs are executed in the order they appear in the job group.

Direct Known Subclasses

PipelineExecutionStrategy

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 sequentially.

Parameters:

  • job_group (Array<Job>)

    Jobs to execute

Returns:

  • (Boolean)

    true if execution should continue



92
93
94
95
96
97
98
99
100
# File 'lib/fractor/workflow/execution_strategy.rb', line 92

def execute(job_group)
  log_debug "Executing #{job_group.size} jobs sequentially: #{job_group.map(&:name).join(', ')}"

  job_group.each do |job|
    execute_single_job(job)
  end

  true
end