View Source Runbox.StateStore.Storage.BinaryStorage (runbox v21.2.0)
Runbox.StateStore.Storage
behaviour implementation.
This implementation uses erlang built-in :erlang.term_to_binary/1
and :erlang.binary_to_term/1
functions to persist and restore run state.
Summary
Types
@type run_id() :: String.t()
Functions
@spec decode_savepoint(binary()) :: {:ok, Runbox.StateStore.ScheduleUtils.epoch_ms(), [{Runbox.StateStore.Entity.id(), Runbox.StateStore.Entity.state()}]} | {:error, :corrupted_savepoint}
@spec encode_savepoint(Runbox.StateStore.ScheduleUtils.epoch_ms(), [ {Runbox.StateStore.Entity.id(), Runbox.StateStore.Entity.state()} ]) :: {:ok, binary()}