/// <summary>
 /// Need to subscribe to cluster changes
 /// </summary>
 protected override void PreStart()
 {
     Cluster = Cluster.Get(Context.System);
     // subscribe to IMemberEvent and UnreachableMember events
     Cluster.Subscribe(Self, ClusterEvent.InitialStateAsEvents,
                       new[] { typeof(ClusterEvent.IMemberEvent), typeof(ClusterEvent.UnreachableMember) });
 }
Esempio n. 2
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="autoDownUnreachableAfter">TBD</param>
 public AutoDown(TimeSpan autoDownUnreachableAfter) : base(autoDownUnreachableAfter)
 {
     _cluster = Cluster.Get(Context.System);
 }
Esempio n. 3
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="system">TBD</param>
 public AutoDowning(ActorSystem system)
 {
     _clusterSettings = Cluster.Get(system).Settings;
 }
Esempio n. 4
0
        public ClusterHeartbeatReceiver()
        {
            // Important - don't use Cluster.Get(Context.System) in constructor because that would
            // cause deadlock. See startup sequence in ClusterDaemon.
            _selfHeartbeatRsp = new Lazy <ClusterHeartbeatSender.HeartbeatRsp>(() =>
                                                                               new ClusterHeartbeatSender.HeartbeatRsp(Cluster.Get(Context.System).SelfUniqueAddress));

            Receive <ClusterHeartbeatSender.Heartbeat>(heartbeat => Sender.Tell(_selfHeartbeatRsp.Value));
        }
 /// <summary>
 /// This constructor is used when creating an instance from configured fully-qualified name
 /// </summary>
 public PerformanceCounterMetricsCollector(ActorSystem system) : this(Cluster.Get(system))
 {
 }
Esempio n. 6
0
 public ClusterHeartbeatReceiver()
 {
     _selfHeartbeatRsp = new ClusterHeartbeatSender.HeartbeatRsp(Cluster.Get(Context.System).SelfUniqueAddress);
     Receive <ClusterHeartbeatSender.Heartbeat>(heartbeat => Sender.Tell(_selfHeartbeatRsp));
 }