raft_fleet v0.1.13 RaftFleet.Cluster

Summary

Functions

Generic read/write operation on the stored value

Creates an initial value to be stored

Read-only operation on the stored value

Functions

command(data, arg)
command(t, Data.command_arg) :: {Data.command_ret, t}

Generic read/write operation on the stored value.

This callback function is invoked by RaftedValue.command/4. Commands are replicated across members of the consensus group and executed in all members in order to reproduce the same history of stored value. This function should return a pair of “return value to client” and “next version of stored data”.

Callback implementation for RaftedValue.Data.command/2.

new()
new() :: t

Creates an initial value to be stored.

Whenever a new consensus group is started by RaftedValue.start_link/2 (called with :create_new_consensus_group), this function is called to initialize the stored value.

Callback implementation for RaftedValue.Data.new/0.

query(data, arg)
query(t, Data.query_arg) :: Data.query_ret

Read-only operation on the stored value.

This callback function is invoked by RaftedValue.query/3. This function should return “return value to client”.

Callback implementation for RaftedValue.Data.query/2.