struct Raft::RPC::AppendEntries

Overview

Sent by the leader to replicate log entries and serve as heartbeat.

An empty #entries array acts as a heartbeat without appending any entries.

Defined in:

raft/rpc.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(term : UInt64, leader_id : String, prev_log_index : UInt64, prev_log_term : UInt64, entries : Array(Log::Entry), leader_commit : UInt64) #

[View source]

Instance Method Detail

def entries : Array(Log::Entry) #

Log entries to append (empty for heartbeats).


[View source]
def leader_commit : UInt64 #

The leader's commit index.


[View source]
def leader_id : String #

The ID of the leader, so followers can redirect clients.


[View source]
def prev_log_index : UInt64 #

Index of the log entry immediately preceding the new entries.


[View source]
def prev_log_term : UInt64 #

Term of the entry at #prev_log_index.


[View source]
def term : UInt64 #

The leader's current term.


[View source]
def type : Type #

[View source]