public <R> EtcdResponsePromise<R> send(final EtcdRequest<R> etcdRequest) throws IOException {
    ConnectionState connectionState = new ConnectionState(uris, lastWorkingUriIndex);

    if (etcdRequest.getPromise() == null) {
      etcdRequest.setPromise(new EtcdResponsePromise<R>(
        etcdRequest.getRetryPolicy(),
        connectionState,
        new RetryHandler() {
          @Override
          public void doRetry(ConnectionState connectionState) throws IOException {
            connect(etcdRequest, connectionState);
          }
      }));
    }

    connect(etcdRequest, connectionState);

    return etcdRequest.getPromise();
  }
public < R > EtcdResponsePromise < R > send ( final EtcdRequest < R > etcdRequest ) throws IOException { ConnectionState connectionState = new ConnectionState ( uris , lastWorkingUriIndex ) ; if ( etcdRequest . getPromise ( ) == null ) { etcdRequest . setPromise ( new EtcdResponsePromise < R > ( etcdRequest . getRetryPolicy ( ) , connectionState , new RetryHandler ( ) { @ Override public void doRetry ( ConnectionState connectionState ) throws IOException { connect ( etcdRequest , connectionState ) ; } } ) ) ; } connect ( etcdRequest , connectionState ) ; return etcdRequest . getPromise ( ) ; }
Send a request and get a future.

@param etcdRequest Etcd Request to send
@return Promise for the request.