public Node(NodeSettings nodeSettings) { if (nodeSettings == null) { throw new ArgumentNullException("nodeSettings"); } settings = nodeSettings; requestHandler = new Follower(this); electionTimeout = nodeSettings.ElectionTimeout; Id = settings.NodeId; LocalLog = new Log(); ServerLog = new Log(); Term = 1; disposables.Add(nodeSettings.PeerObserver .Subscribe(Observer.Create<IEnumerable<Peer>>(peers => { Peers = peers.Where(p => p.Id != Id); //Peers.ForEach(p => Debug.WriteLine("{0} new peer discovered: {1}", NodeInfo(), p.Id)); }, ex => Debug.WriteLine("OnError: {0}", ex.Message), () => Debug.WriteLine("OnCompleted")))); }
public TestNode(NodeSettings nodeSettings) : base(nodeSettings) { }