Beispiel #1
0
 public static RaftMessage NewVoteResponse(
     int nodeId,
     Guid requestId,
     VoteResponse voteResponse)
 {
     return(new RaftMessage(nodeId, requestId, null, null, null, voteResponse, voteResponse.Term));
 }
Beispiel #2
0
        private RaftMessage(
            int sourceNodeId,
            Guid requestId,
            AppendEntriesRequest appendEntriesRequest,
            AppendEntriesResponse appendEntriesResponse,
            VoteRequest voteRequest,
            VoteResponse voteResponse,
            int term)
        {
            RequestId    = requestId;
            SourceNodeId = sourceNodeId;

            AppendEntriesRequest  = appendEntriesRequest;
            AppendEntriesResponse = appendEntriesResponse;

            VoteRequest  = voteRequest;
            VoteResponse = voteResponse;
            Term         = term;
        }