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.



63
64
65
66
67
# File 'lib/nexo/workflow.rb', line 63

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

Instance Attribute Details

#reason ⇒ Object (readonly)

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



60
61
62
# File 'lib/nexo/workflow.rb', line 60

def reason
  @reason
end

#resume_key ⇒ Object (readonly)

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



60
61
62
# File 'lib/nexo/workflow.rb', line 60

def resume_key
  @resume_key
end