Skip to content

Instantly share code, notes, and snippets.

@tsegismont
Created January 20, 2017 22:23
Show Gist options
  • Save tsegismont/c37874762224b6ecee76490cd506f0ca to your computer and use it in GitHub Desktop.
Save tsegismont/c37874762224b6ecee76490cd506f0ca to your computer and use it in GitHub Desktop.
public <R> void send(BodyCodec<R> responseCodec, Handler<AsyncResult<HttpResponse<R>>> handler) {
delegate.send(responseCodec.getDelegate(), new Handler<AsyncResult<io.vertx.webclient.HttpResponse<R>>>() {
public void handle(AsyncResult<io.vertx.webclient.HttpResponse<R>> ar) {
if (ar.succeeded()) {
handler.handle(io.vertx.core.Future.succeededFuture(HttpResponse.newInstance(ar.result(), io.vertx.lang.rxjava.TypeArg.unknown())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment