Esempio n. 1
0
 public VoteReceived(IObserver<RequestVoteResultMessage> voteReply,
     ServerIdentifier serverIdentifier,
     IObservable<RequestVoteMessage> requestVote, 
     Election election,
     ILoggerFactory loggerFactory,
     Nodes nodes,
     RaftOptions options, 
     ILogReplication logReplication)
 {
     _voteReply = voteReply;
     _election = election;
     _nodes = nodes;
     _options = options;
     _logReplication = logReplication;
     _serverIdentifier = serverIdentifier;
     _voteReceivedDisposable = requestVote.Subscribe(VoteRequestReceived);
     _logger = loggerFactory.CreateLogger(nameof(VoteReceived) + " " + serverIdentifier);
 }
Esempio n. 2
0
 public AppendEntry(IObserver<AppendEntryResultMessage> entryReply,
    IObservable<AppendEntryMessage> receivedAppendEntryMessage,
    IHartbeatTimer hartbeat,
    ILogReplication logReplication, 
    Election election,
    ILoggerFactory loggerFactory,
    RaftOptions options, 
    ServerIdentifier serverIdentifier,
    IEnumerable<IRaftService> services)
 {
     _entryReply = entryReply;
     _hartbeat = hartbeat;
     _receivedDisposable =  receivedAppendEntryMessage.Subscribe(RaciveHartbeat);
     _logReplication = logReplication;
     _election = election;
     _options = options;
     _serverIdentifier = serverIdentifier;
     _services = services;
     _logger = loggerFactory.CreateLogger(nameof(AppendEntry) + " " + serverIdentifier);
 }