Validates job state transitions for Kathikon v0.2.0.
Invalid transitions return {:error, {:invalid_transition, from, to}}.
Terminal states reject all outbound transitions.
Allowed transitions
scheduled -> available
scheduled -> cancelled
available -> claimed
available -> cancelled
claimed -> running
claimed -> cancelled
running -> completed
running -> retryable
running -> failed
running -> waiting_for_children
waiting_for_children -> completed
waiting_for_children -> failed
retryable -> scheduled
retryable -> available
failed -> dead
failed -> discardedClaiming also moves :retryable jobs to :claimed when they are due.
Summary
Functions
Returns true when to is allowed from from.
Returns the list of states reachable from state.
Returns all supported states.
Returns true when the job is in a terminal state.
Validates a transition. Returns :ok or {:error, {:invalid_transition, from, to}}.
Functions
Returns true when to is allowed from from.
Returns the list of states reachable from state.
@spec states() :: [atom()]
Returns all supported states.
Returns true when the job is in a terminal state.
Validates a transition. Returns :ok or {:error, {:invalid_transition, from, to}}.