roger v1.0.0 Roger.Partition.Global.StatePersister behaviour

Behaviour for the persistence of the global partition state.

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

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

Callbacks

init(id)
init(id :: String.t) :: :ok

Called when the global state process starts.

load(id)
load(id :: String.t) :: {:ok, binary} | {:error, term}

Called when the global state needs to be loaded.

store(id, data)
store(id :: String.t, data :: binary) :: :ok

Called when the global state needs to be stored.