Documentation
¶
Overview ¶
Package runstate normalizes supervisor lifecycle status for consumers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTerminalStatus ¶
IsTerminalStatus reports whether a consumer-facing status is terminal.
func IsTurnComplete ¶
IsTurnComplete reports whether a raw supervisor status and phase identify a completed turn. It uses the same normalization as Translate so callers do not need to reproduce the running/terminal-phase race handling.
Types ¶
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine derives await decisions from authoritative snapshots. Its zero value is ready to use.
func (*Machine) ObserveEvent ¶
ObserveEvent treats lifecycle events as wakeups only. State-relevant and lag notifications request an authoritative snapshot; no event, including a lag notification, changes state or directly exits the await loop.
func (*Machine) ObserveSnapshot ¶
ObserveSnapshot replaces the machine state with the state derived from the supplied snapshot. The update is idempotent for a repeated snapshot.
type Snapshot ¶
Snapshot contains the authoritative lifecycle fields used to decide whether an await operation keeps waiting or returns.
type Translation ¶
Translation is the consumer-facing lifecycle state derived from a raw supervisor status and phase.
func Translate ¶
func Translate(status, phase string) Translation
Translate normalizes a raw supervisor status and phase. An idle runtime is complete only when its phase is terminal. A running runtime stays running even when terminal phase metadata arrives before active-attempt cleanup finishes.