Class: RubyReactor::Skipped
Overview
A “clean halt” signal. Two ways to produce one:
1. Implicitly, when a reactor's `with_period` gate finds the bucket has
already been claimed. The executor short-circuits before any step
runs.
2. Explicitly, by returning `RubyReactor.Skipped(reason: "...")` from a
step's `run` block. The reactor halts immediately — no further steps,
and crucially **no compensation** of already-completed steps. Use this
when a step discovers that the rest of the workflow is not needed
(e.g. "user already opted out", "nothing to do this round") and the
partial progress is still correct to keep.
Subclass of Success so callers that only check ‘success?` continue to work; `skipped?` distinguishes it.
Instance Attribute Summary collapse
-
#period_key ⇒ Object
readonly
Returns the value of attribute period_key.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#step_name ⇒ Object
readonly
Returns the value of attribute step_name.
Attributes inherited from Success
Instance Method Summary collapse
-
#initialize(reason: nil, period_key: nil, step_name: nil) ⇒ Skipped
constructor
A new instance of Skipped.
- #skipped? ⇒ Boolean
Methods inherited from Success
Constructor Details
#initialize(reason: nil, period_key: nil, step_name: nil) ⇒ Skipped
Returns a new instance of Skipped.
77 78 79 80 81 82 |
# File 'lib/ruby_reactor.rb', line 77 def initialize(reason: nil, period_key: nil, step_name: nil) super(nil) @reason = reason @period_key = period_key @step_name = step_name end |
Instance Attribute Details
#period_key ⇒ Object (readonly)
Returns the value of attribute period_key.
75 76 77 |
# File 'lib/ruby_reactor.rb', line 75 def period_key @period_key end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
75 76 77 |
# File 'lib/ruby_reactor.rb', line 75 def reason @reason end |
#step_name ⇒ Object (readonly)
Returns the value of attribute step_name.
75 76 77 |
# File 'lib/ruby_reactor.rb', line 75 def step_name @step_name end |
Instance Method Details
#skipped? ⇒ Boolean
84 85 86 |
# File 'lib/ruby_reactor.rb', line 84 def skipped? true end |