resp.customFrameHandler(frame -> { System.out.println("Got frame from server " + frame.payload().toString("UTF-8")); });
Context ctx = Vertx.currentContext(); assertEquals(0, status.getAndIncrement()); resp.customFrameHandler(frame -> { assertOnIOContext(ctx); assertEquals(1, status.getAndIncrement());
/** * Set an custom frame handler. The handler will get notified when the http stream receives an custom HTTP/2 * frame. HTTP/2 permits extension of the protocol. * @param handler * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.core.http.HttpClientResponse customFrameHandler(Handler<io.vertx.rxjava.core.http.HttpFrame> handler) { delegate.customFrameHandler(new Handler<io.vertx.core.http.HttpFrame>() { public void handle(io.vertx.core.http.HttpFrame event) { handler.handle(io.vertx.rxjava.core.http.HttpFrame.newInstance(event)); } }); return this; }
/** * Set an custom frame handler. The handler will get notified when the http stream receives an custom HTTP/2 * frame. HTTP/2 permits extension of the protocol. * @param handler * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.core.http.HttpClientResponse customFrameHandler(Handler<io.vertx.rxjava.core.http.HttpFrame> handler) { delegate.customFrameHandler(new Handler<io.vertx.core.http.HttpFrame>() { public void handle(io.vertx.core.http.HttpFrame event) { handler.handle(io.vertx.rxjava.core.http.HttpFrame.newInstance(event)); } }); return this; }
Context ctx = Vertx.currentContext(); assertEquals(0, status.getAndIncrement()); resp.customFrameHandler(frame -> { assertOnIOContext(ctx); assertEquals(1, status.getAndIncrement());