Пример #1
0
        public ClientHolder(ZooKeeperClientSettings settings, ILog log)
        {
            this.log      = log;
            this.settings = settings;

            state = new ClientHolderState(null, null, ConnectionState.Disconnected, null);

            ZooKeeperLogInjector.Register(this, this.log);
        }
Пример #2
0
        public ClientHolder(ZooKeeperClientSettings settings, ILog log)
        {
            this.log      = log;
            this.settings = settings;

            state            = ClientHolderState.CreateActive(null, null, ConnectionState.Disconnected, null, settings);
            suspendedManager = new SuspendedManager(settings.Timeout, settings.Timeout.Multiply(settings.MaximumConnectPeriodMultiplier), -3);

            ZooKeeperLogInjector.Register(this, this.log);
        }
Пример #3
0
        public void Dispose()
        {
            if (isDisposed.TrySetTrue())
            {
                var oldState = Interlocked.Exchange(ref state, null);

                SendOnConnectionStateChanged(true);

                oldState.NextState.TrySetResult(null);

                oldState.Dispose();

                ZooKeeperLogInjector.Unregister(this);
            }
        }