Exception: Nexo::Workflow::Suspended

Inherits:
StandardError
  • Object
show all
Defined in:
lib/nexo/workflow.rb

Overview

Control-flow signal raised by #suspend! and caught by ::execute to pause a run durably — NOT a failure. It transitions the run to "suspended" (never "failed") and returns the run to the caller rather than re-raising. Carries the reason (surfaced to a host UI) and an optional resume_key (persisted so a host can correlate which resume it is awaiting — Spec 13 Q2).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, resume_key = nil) ⇒ Suspended

Builds the suspend signal for reason with an optional resume_key.



61
62
63
64
65
# File 'lib/nexo/workflow.rb', line 61

def initialize(reason, resume_key = nil)
  @reason = reason
  @resume_key = resume_key
  super("workflow suspended: #{reason}")
end

Instance Attribute Details

#reasonObject (readonly)

The pause reason (surfaced to a host UI) and the optional resume_key a host can correlate the awaited resume against.



58
59
60
# File 'lib/nexo/workflow.rb', line 58

def reason
  @reason
end

#resume_keyObject (readonly)

The pause reason (surfaced to a host UI) and the optional resume_key a host can correlate the awaited resume against.



58
59
60
# File 'lib/nexo/workflow.rb', line 58

def resume_key
  @resume_key
end