示例#1
0
        public void Start()
        {
            if (!_live.CompareAndSet(false, true))
            {
                return;
            }
            _credentialsFactory = _client.GetCredentialsFactory();

            //start Heartbeat
            _heartbeatToken = new CancellationTokenSource();
            _client.GetClientExecutionService().ScheduleWithFixedDelay(Heartbeat,
                                                                       (long)_heartbeatInterval.TotalMilliseconds,
                                                                       (long)_heartbeatInterval.TotalMilliseconds,
                                                                       TimeUnit.Milliseconds,
                                                                       _heartbeatToken.Token);
        }