Ejemplo n.º 1
0
 /// <summary>
 /// Need to subscribe to cluster changes
 /// </summary>
 protected override void PreStart()
 {
     Cluster.Subscribe(Self, new[] { typeof(ClusterEvent.MemberUp) });
     Cluster.RegisterOnMemberUp(() =>
     {
         // create routers and other things that depend on me being UP in the cluster
     });
 }
Ejemplo n.º 2
0
        protected override void PreStart()
        {
            var self = Self;

            _cluster.RegisterOnMemberUp(() => { self.Tell(new ReadinessStatus(true)); });

            _cluster.RegisterOnMemberRemoved(() => { self.Tell(new ReadinessStatus(false)); });

            _cluster.Subscribe(Self, ClusterEvent.SubscriptionInitialStateMode.InitialStateAsSnapshot,
                               typeof(ClusterEvent.IReachabilityEvent));
        }