Raft v0.2.1 Raft.RPC

Defines multiple rpc commands and functions for broadcasting messages to other peers.

Link to this section Summary

Functions

Sends a message to a server

Link to this section Types

Link to this type msg()
msg() ::
  %Raft.RPC.AppendEntriesReq{
    entries: term(),
    from: term(),
    leader_commit: term(),
    leader_id: term(),
    prev_log_index: term(),
    prev_log_term: term(),
    term: term(),
    to: term()
  }
  | %Raft.RPC.AppendEntriesResp{
      from: term(),
      index: term(),
      success: term(),
      term: term(),
      to: term()
    }
  | %Raft.RPC.RequestVoteReq{
      candidate_id: term(),
      from: term(),
      last_log_index: term(),
      last_log_term: term(),
      term: term(),
      to: term()
    }
  | %Raft.RPC.RequestVoteResp{
      from: term(),
      term: term(),
      to: term(),
      vote_granted: term()
    }
Link to this type server()
server() :: pid()

Link to this section Functions

Link to this function broadcast(rpcs)
Link to this function send_msg(rpc)
send_msg(msg()) :: pid()

Sends a message to a server