Пример #1
0
 public static RaftMessage NewVoteRequest(
     int nodeId,
     Guid requestId,
     VoteRequest voteRequest)
 {
     return(new RaftMessage(nodeId, requestId, null, null, voteRequest, null, voteRequest.Term));
 }
Пример #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;
        }