Module: Smith::Workflow::SplitStepPersistence::Execution

Defined in:
lib/smith/workflow/split_step_persistence/execution.rb

Instance Method Summary collapse

Instance Method Details

#execute_authorized_prepared_step!(authorization) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/smith/workflow/split_step_persistence/execution.rb', line 15

def execute_authorized_prepared_step!(authorization)
  authorization = validate_split_step_execution_authorization!(authorization)
  step = nil
  result = nil
  execution_thread = Thread.current
  execution_active = false
  begin
    activate_split_step_execution!(authorization, execution_thread)
    execution_active = true
    step = execute_claimed_split_step_transition!
    result = consume_split_step_execution_result!(execution_thread)
  ensure
    finish_split_step_execution!(step, authorization, execution_thread) if execution_active
  end
  result
end

#execute_prepared_step!Object



7
8
9
10
11
12
13
# File 'lib/smith/workflow/split_step_persistence/execution.rb', line 7

def execute_prepared_step!
  authorization = ExecutionAuthorization
                  .instance_method(:authorize_prepared_step_execution!)
                  .bind_call(self)
  result = Execution.instance_method(:execute_authorized_prepared_step!).bind_call(self, authorization)
  result.step_snapshot
end

#prepared_persisted_step?Boolean

Returns:

  • (Boolean)


32
33
34
35
36
37
# File 'lib/smith/workflow/split_step_persistence/execution.rb', line 32

def prepared_persisted_step?
  @split_step_mutex.synchronize do
    expected = restart_safe_split_step? ? :dispatch_claimed : :prepared
    [expected, :execution_authorized].include?(@split_step_phase)
  end
end