protected override void OnReceive(object message)
{
var state = message as ClusterEvent.CurrentClusterState;
if (state != null)
{
if (state.Members.Any(m => m.Address == _oldLeaderAddress && m.Status == MemberStatus.Exiting))
_latch.CountDown();
}
var memberExited = message as ClusterEvent.MemberExited;
if(memberExited != null && memberExited.Member.Address == _oldLeaderAddress)
_latch.CountDown();
}
}