Runtime representation of a specification instance and its observed history.
Summary
Functions
Returns whether the instance exceeded its specification transition timeout.
Initialises a new instance with an empty transition history.
Records an observed transition and updates the current state.
Returns whether the instance is currently eligible for pruning.
Types
@type instance_identifier() :: term()
@type meta() :: map()
@type t() :: %Spex.InstanceManager.Instance{ current_state: Spex.state() | nil, identifier: instance_identifier(), meta: meta() | nil, specification: Spex.Specification.t(), transitions: [transition_record()] }
@type transition_record() :: {action :: Spex.action(), to_state :: Spex.state(), timestamp :: DateTime.t()}
Functions
@spec beyond_transition_timeout?(t(), DateTime.t()) :: boolean()
Returns whether the instance exceeded its specification transition timeout.
@spec initialise(Spex.Specification.t(), instance_identifier(), meta() | nil) :: t()
Initialises a new instance with an empty transition history.
@spec observe_transition(t(), Spex.action(), Spex.state()) :: t()
Records an observed transition and updates the current state.
Returns whether the instance is currently eligible for pruning.