Beispiel #1
0
 public Follower(Node node)
 {
     if (node == null)
     {
         throw new ArgumentNullException("node");
     }
     this.node = node;
 }
Beispiel #2
0
 public Candidate(Node node)
 {
     if (node == null)
     {
         throw new ArgumentNullException("node");
     }
     this.node = node;
 }
Beispiel #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;
 }
Beispiel #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;
 }