Class: ChronoForge::Dashboard::WaitStatePresenter::Active

Inherits:
Struct
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#conditionObject

Returns the value of attribute condition

Returns:

  • (Object)

    the current value of condition



8
9
10
# File 'app/presenters/chrono_forge/dashboard/wait_state_presenter.rb', line 8

def condition
  @condition
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



8
9
10
# File 'app/presenters/chrono_forge/dashboard/wait_state_presenter.rb', line 8

def kind
  @kind
end

#timeout_atObject

Returns the value of attribute timeout_at

Returns:

  • (Object)

    the current value of timeout_at



8
9
10
# File 'app/presenters/chrono_forge/dashboard/wait_state_presenter.rb', line 8

def timeout_at
  @timeout_at
end

#waiting_sinceObject

Returns the value of attribute waiting_since

Returns:

  • (Object)

    the current value of 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

Returns:

  • (Boolean)


17
# File 'app/presenters/chrono_forge/dashboard/wait_state_presenter.rb', line 17

def event_wait? = kind == :continue

#next_run_atObject

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.

Returns:

  • (Boolean)


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