Roger.Partition.Global.StatePersister behaviour (roger v4.0.1)

Copy Markdown View Source

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)

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

Called when the global state process starts.

load(id)

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

Called when the global state needs to be loaded.

store(id, data)

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

Called when the global state needs to be stored.