Пример #1
0
 private void TriggerFirstHeart(UniqueAddress from)
 {
     if (_state.ActiveReceivers.Contains(from) && !FailureDetector.IsMonitoring(from.Address))
     {
         Log.Debug("Cluster Node [{0}] - Trigger extra expected heartbeat from [{1}]", _cluster.SelfAddress, from.Address);
         FailureDetector.Heartbeat(from.Address);
     }
 }
Пример #2
0
 private void DoHeartbeat()
 {
     foreach (var to in _state.ActiveReceivers)
     {
         if (FailureDetector.IsMonitoring(to.Address))
         {
             Log.Debug("Cluster Node [{0}] - Heartbeat to [{1}]", _cluster.SelfAddress, to.Address);
         }
         else
         {
             Log.Debug("Cluster Node [{0}] - First Heartbeat to [{1}]", _cluster.SelfAddress, to.Address);
             // schedule the expected first heartbeat for later, which will give the
             // other side a chance to reply, and also trigger some resends if needed
             Context.System.Scheduler.ScheduleOnce(_cluster.Settings.HeartbeatExpectedResponseAfter, Self,
                                                   new ExpectedFirstHeartbeat(to));
         }
         HeartbeatReceiver(to.Address).Tell(_selfHeartbeat);
     }
 }