View Source Runbox.StateStore.Savepoint (runbox v21.2.0)
Savepoint represents state of runtime run valid to scheduled timestamp.
Summary
Functions
Predicate returning true when all registered states has been saved.
Returns entities with saved states.
Creates new savepoint with given timestamp and register entities.
Returns all registered entity ids.
Returns registered entities count of given savepoint.
Saves entity state in given savepoint.
Returns savepoint timestamp.
Types
@type t() :: %Runbox.StateStore.Savepoint{ entity_registry: %{ required(Runbox.StateStore.Entity.id()) => :not_set_yet | Runbox.StateStore.Entity.state() }, stats: %{registered: integer(), saved: integer()}, timestamp: Runbox.StateStore.ScheduleUtils.epoch_ms() }
Functions
Predicate returning true when all registered states has been saved.
@spec entity_states(t()) :: [ {Runbox.StateStore.Entity.id(), Runbox.StateStore.Entity.state()} ]
Returns entities with saved states.
@spec new([Runbox.StateStore.Entity.id()], Runbox.StateStore.ScheduleUtils.epoch_ms()) :: t()
Creates new savepoint with given timestamp and register entities.
@spec registered_entities(t()) :: [Runbox.StateStore.Entity.id()]
Returns all registered entity ids.
Returns registered entities count of given savepoint.
@spec save(t(), Runbox.StateStore.Entity.id(), Runbox.StateStore.Entity.state()) :: t()
Saves entity state in given savepoint.
@spec timestamp(t()) :: Runbox.StateStore.ScheduleUtils.epoch_ms()
Returns savepoint timestamp.