RaftFleet.command

You're seeing just the function command, go back to RaftFleet module for more information.
Link to this function

command(name, command_arg, timeout \\ 500, retry \\ 3, retry_interval \\ 1000, call_module \\ :gen_statem)

View Source

Specs

command(
  atom(),
  RaftedValue.Data.command_arg(),
  pos_integer(),
  non_neg_integer(),
  pos_integer(),
  module()
) :: {:ok, RaftedValue.Data.command_ret()} | {:error, :no_leader}

Executes a command on the replicated value identified by name.

The target consensus group identified by name must be registered beforehand using add_consensus_group/3. This function automatically resolves the leader process of the consensus group, caches PID of the current leader in local ETS table and send the given command to the leader.

timeout is used in each synchronous messaging. In order to tolerate temporal absences of leaders during Raft leader elections, it retries requests up to retry. Before retrying requests this function sleeps for retry_interval milliseconds. Thus for worst case this function blocks the caller for timeout * (retry + 1) + retry_interval * retry. Note that for complete masking of leader elections retry_interval * retry must be sufficiently longer than the time scale for leader elections (:election_timeout in RaftedValue.Config.t).

call_module can be changed from the default (:gen_statem module) with an alternative module that exports call/3 for optimization of remote message passing.

See also RaftedValue.command/5.