Ejemplo n.º 1
0
        public BusyScope(IFailureDetector failureDetector)
        {
            _failureDetector = failureDetector;
            IsBusy = true;

            TurnBlueLedOn();
        }
Ejemplo n.º 2
0
        protected override Task OnActivateAsync()
        {
            if (this.Nodes == null)
            {
                this.NumberOfNodes = 2;

                this.Nodes   = new Dictionary <int, INode>();
                this.NodeMap = new Dictionary <INode, bool>();

                this.FailureDetector = ActorProxy.Create <IFailureDetector>(
                    new ActorId(1), "FailureDetectorProxy");

                this.Initialize();

                var configureTask = this.FailureDetector.Configure(this.Nodes.Keys.ToList());
                ActorModel.Wait(configureTask);

                var registerTask = this.FailureDetector.RegisterClient(0);
                ActorModel.Wait(registerTask);

                this.FailureDetector.Start();

                //this.Fail();
            }

            return(base.OnActivateAsync());
        }
Ejemplo n.º 3
0
        public async Task Start()
        {
            ActorEventSource.Current.ActorMessage(this, "[Driver] is starting");

            if (this.Nodes == null)
            {
                this.NumberOfNodes = 2;

                this.Nodes   = new Dictionary <int, INode>();
                this.NodeMap = new Dictionary <INode, bool>();

                this.SafetyMonitor   = ActorProxy.Create <ISafetyMonitor>(new ActorId(1), "fabric:/FabricFailureDetector");
                this.FailureDetector = ActorProxy.Create <IFailureDetector>(new ActorId(2), "fabric:/FabricFailureDetector");

                await this.Initialize();

                await this.FailureDetector.Configure(this.Nodes.Keys.ToList());

                await this.FailureDetector.RegisterClient(0);

                await this.FailureDetector.Start();

                //this.Fail();
            }
        }
Ejemplo n.º 4
0
 public Executor(ITracer tracer, IFailureDetector failureDetector)
 {
     _tracer          = tracer;
     _failureDetector = failureDetector;
 }