feat: implement raft election and term state
This commit is contained in:
14
src/NATS.Server/Raft/RaftTermState.cs
Normal file
14
src/NATS.Server/Raft/RaftTermState.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace NATS.Server.Raft;
|
||||
|
||||
public sealed class RaftTermState
|
||||
{
|
||||
public int CurrentTerm { get; set; }
|
||||
public string? VotedFor { get; set; }
|
||||
}
|
||||
|
||||
public enum RaftRole
|
||||
{
|
||||
Follower,
|
||||
Candidate,
|
||||
Leader,
|
||||
}
|
||||
Reference in New Issue
Block a user