roger v1.2.0 Roger.Partition.Global.StatePersister behaviour View Source

Behaviour for the persistence of the global partition state.

See Roger.Partition.Global on how to implement a custom persister module.

Link to this section Summary

Callbacks

Called when the global state process starts

Called when the global state needs to be loaded

Called when the global state needs to be stored

Link to this section Callbacks

Link to this callback init(id) View Source
init(id :: String.t()) :: :ok

Called when the global state process starts.

Link to this callback load(id) View Source
load(id :: String.t()) :: {:ok, binary()} | {:error, term()}

Called when the global state needs to be loaded.

Link to this callback store(id, data) View Source
store(id :: String.t(), data :: binary()) :: :ok

Called when the global state needs to be stored.