@Override
  public Promise<Void> start() {
    AtomicBoolean committed = new AtomicBoolean(false);
    SettablePromise<Void> promise = Promises.settable();
    _listener.subscribe(KeeperState.SyncConnected,
        (Promise p) -> {
          if (committed.compareAndSet(false, true)) {
            if (p.isFailed()) {
              promise.fail(p.getError());
            } else {
              promise.done(null);
            }
          }
        }
    );

    try {
      _zkClient = new ZooKeeper(_connectionString, _sessionTimeout, _defaultWatcher);
      _reaper = new Reaper(_engine);
    } catch (IOException ex) {
      if (committed.compareAndSet(false, true)) {
        promise.fail(ex);
      }
    }
    return promise;
  }
@Override
  public Promise<Void> start() {
    AtomicBoolean committed = new AtomicBoolean(false);
    SettablePromise<Void> promise = Promises.settable();
    _listener.subscribe(KeeperState.SyncConnected,
        (Promise p) -> {
          if (committed.compareAndSet(false, true)) {
            if (p.isFailed()) {
              promise.fail(p.getError());
            } else {
              promise.done(null);
            }
          }
        }
    );

    try {
      _zkClient = new ZooKeeper(_connectionString, _sessionTimeout, _defaultWatcher);
      _reaper = new Reaper(_engine);
    } catch (IOException ex) {
      if (committed.compareAndSet(false, true)) {
        promise.fail(ex);
      }
    }
    return promise;
  }
@ Override public Promise < Void > start ( ) { AtomicBoolean committed = new AtomicBoolean ( false ) ; SettablePromise < Void > promise = Promises . settable ( ) ; _listener . subscribe ( KeeperState . SyncConnected , ( Promise p ) -> { if ( committed . compareAndSet ( false , true ) ) { if ( p . isFailed ( ) ) { promise . fail ( p . getError ( ) ) ; } else { promise . done ( null ) ; } } } ) ; try { _zkClient = new ZooKeeper ( _connectionString , _sessionTimeout , _defaultWatcher ) ; _reaper = new Reaper ( _engine ) ; } catch ( IOException ex ) { if ( committed . compareAndSet ( false , true ) ) { promise . fail ( ex ) ; } } return promise ; }
{@inheritDoc}
{