private void DoHeartbeat()
{
foreach (var to in _state.ActiveReceivers)
{
if (FailureDetector.IsMonitoring(to.Address))
{
if (_cluster.Settings.VerboseHeartbeatLogging)
{
_log.Debug("Cluster Node [{0}] - Heartbeat to [{1}]", _cluster.SelfAddress, to.Address);
}
}
else
{
if (_cluster.Settings.VerboseHeartbeatLogging)
{
_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.ScheduleTellOnce(_cluster.Settings.HeartbeatExpectedResponseAfter, Self,
new ExpectedFirstHeartbeat(to), Self);
}
HeartbeatReceiver(to.Address).Tell(_selfHeartbeat);
}
}