예제 #1
0
 public Follower(Node node)
 {
     if (node == null)
     {
         throw new ArgumentNullException("node");
     }
     this.node = node;
 }
예제 #2
0
 public Candidate(Node node)
 {
     if (node == null)
     {
         throw new ArgumentNullException("node");
     }
     this.node = node;
 }
예제 #3
0
 public string ConfigureAndStartRaft(string nodeId, IObservable<IEnumerable<Peer>> peerObservable)
 {
     thisServersNode = new Node(new NodeSettings(nodeId,
                                                 TimeSpan.FromSeconds(1),
                                                 TimeSpan.FromMilliseconds(100),
                                                 peerObservable));
     thisServersNode.Start();
     return thisServersNode.Id;
 }
예제 #4
0
        public void ConfigureApplication(IAppBuilder app, string nodeId, IObservable<IEnumerable<Peer>> peerObserver)
        {
            thisServersNode = new Node(new NodeSettings(nodeId,
                                                      TimeSpan.FromSeconds(5),
                                                      TimeSpan.FromSeconds(1),
                                                      peerObserver));

            var config = new HttpConfiguration();
            var pocket = new PocketContainer();
            config.ResolveDependenciesUsing(pocket);
            pocket.RegisterSingle(c => thisServersNode);
            config.MapHttpAttributeRoutes();
            JsonSerialization(config);
            app.UseWebApi(config);
            thisServersNode.Start();
        }
 public DistributedLoggerController(Node node)
 {
     this.node = node;
 }