Akka.Cluster.Tools.Client.ClusterClient.ClusterClient C# (CSharp) Method

ClusterClient() public method

public ClusterClient ( ClusterClientSettings settings ) : System
settings ClusterClientSettings
return System
        public ClusterClient(ClusterClientSettings settings)
        {
            if (!settings.InitialContacts.Any()) throw new ArgumentException("Initial contacts for cluster client cannot be empty");
            Settings = settings;
            _failureDetector = new DeadlineFailureDetector(Settings.AcceptableHeartbeatPause, () => Settings.HeartbeatInterval.Ticks);
            _initialContactsSelections = settings.InitialContacts.Select(Context.ActorSelection).ToArray();
            _contacts = _initialContactsSelections;
            _buffer = new Queue<Tuple<object, IActorRef>>();

            SendGetContacts();

            _heartbeatCancelable = Context.System.Scheduler.ScheduleTellRepeatedlyCancelable(
                settings.HeartbeatInterval, settings.HeartbeatInterval, Self, InternalMessage.HeartbeatTick, Self);

            ScheduleRefreshContactsTick(settings.EstablishingGetContactsInterval);
            Self.Tell(InternalMessage.RefreshContactsTick);
        }