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 .