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); }
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); }
public void Dispose() { if (isDisposed.TrySetTrue()) { var oldState = Interlocked.Exchange(ref state, null); SendOnConnectionStateChanged(true); oldState.NextState.TrySetResult(null); oldState.Dispose(); ZooKeeperLogInjector.Unregister(this); } }