Class: ChronoForge::Dashboard::WaitStatePresenter::Active
- Inherits:
-
Struct
- Object
- Struct
- ChronoForge::Dashboard::WaitStatePresenter::Active
- Defined in:
- app/presenters/chrono_forge/dashboard/wait_state_presenter.rb
Overview
kind: :wait (wait_until — polls, has a timeout) or :continue (continue_if — waits on an external event, NO timeout, never self-resumes). A stuck continue_if is the silent killer: a webhook that never arrives leaves the workflow parked forever with nothing to flag it.
Instance Attribute Summary collapse
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#timeout_at ⇒ Object
Returns the value of attribute timeout_at.
-
#waiting_since ⇒ Object
Returns the value of attribute waiting_since.
Instance Method Summary collapse
- #event_wait? ⇒ Boolean
-
#next_run_at ⇒ Object
The scheduled wake time as a Time, or nil for event waits / no timeout.
-
#scheduled? ⇒ Boolean
Only a time-based wait with a wake time still in the future is “scheduled” (intentionally parked until then).
Instance Attribute Details
#condition ⇒ Object
Returns the value of attribute condition
8 9 10 |
# File 'app/presenters/chrono_forge/dashboard/wait_state_presenter.rb', line 8 def condition @condition end |
#kind ⇒ Object
Returns the value of attribute kind
8 9 10 |
# File 'app/presenters/chrono_forge/dashboard/wait_state_presenter.rb', line 8 def kind @kind end |
#timeout_at ⇒ Object
Returns the value of attribute timeout_at
8 9 10 |
# File 'app/presenters/chrono_forge/dashboard/wait_state_presenter.rb', line 8 def timeout_at @timeout_at end |
#waiting_since ⇒ Object
Returns the value of attribute waiting_since
8 9 10 |
# File 'app/presenters/chrono_forge/dashboard/wait_state_presenter.rb', line 8 def waiting_since @waiting_since end |
Instance Method Details
#event_wait? ⇒ Boolean
17 |
# File 'app/presenters/chrono_forge/dashboard/wait_state_presenter.rb', line 17 def event_wait? = kind == :continue |
#next_run_at ⇒ Object
The scheduled wake time as a Time, or nil for event waits / no timeout.
20 21 22 23 |
# File 'app/presenters/chrono_forge/dashboard/wait_state_presenter.rb', line 20 def next_run_at return nil unless kind == :wait && timeout_at timeout_at.is_a?(Time) ? timeout_at : Time.zone.parse(timeout_at.to_s) end |
#scheduled? ⇒ Boolean
Only a time-based wait with a wake time still in the future is “scheduled” (intentionally parked until then). Event waits never are.
11 12 13 14 15 |
# File 'app/presenters/chrono_forge/dashboard/wait_state_presenter.rb', line 11 def scheduled? return false unless kind == :wait && timeout_at t = timeout_at.is_a?(Time) ? timeout_at : Time.zone.parse(timeout_at.to_s) t&.future? || false end |