congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HttpClientResponse.resume
Code IndexAdd Tabnine to your IDE (free)

How to use
resume
method
in
io.vertx.core.http.HttpClientResponse

Best Java code snippets using io.vertx.core.http.HttpClientResponse.resume (Showing top 20 results out of 315)

origin: eclipse-vertx/vert.x

@Test
public void testServerDrainHandler() {
 drainingServer(resumeFuture -> {
  client.request(HttpMethod.GET, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, onSuccess(resp -> {
   resp.pause();
   resumeFuture.setHandler(ar -> resp.resume());
  })).end();
 });
 await();
}
origin: eclipse-vertx/vert.x

 vertx.setTimer(500, id -> {
  paused.set(false);
  resp.resume();
 });
}));
origin: eclipse-vertx/vert.x

@Test
public void testHttpClientResumeConnectionOnResponseOnLastMessage() throws Exception {
 server.requestHandler(req -> req.response().end("ok"));
 startServer();
 client.close();
 client = vertx.createHttpClient(new HttpClientOptions().setKeepAlive(true).setMaxPoolSize(1));
 client.getNow(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, onSuccess(resp1 -> {
  resp1.pause();
  // The connection resume is asynchronous and the end message will be received before connection resume happens
  resp1.resume();
  client.getNow(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, onSuccess(resp2 -> {
   testComplete();
  }));
 }));
 await();
}
origin: eclipse-vertx/vert.x

   testComplete();
  });
  resp.resume();
 });
});
origin: eclipse-vertx/vert.x

 resp.pause();
 vertx.setTimer(1, id -> {
  resp.resume();
 });
});
origin: eclipse-vertx/vert.x

 });
 whenFull.setHandler(v -> {
  resp.resume();
 });
}));
origin: eclipse-vertx/vert.x

@Test
public void testHttpClientResponseBufferedWithPausedEnd() throws Exception {
 AtomicInteger i = new AtomicInteger();
 server.requestHandler(req -> {
  req.response().end("HelloWorld" + i.incrementAndGet());
 });
 startServer();
 client.close();
 client = vertx.createHttpClient(new HttpClientOptions().setMaxPoolSize(1).setKeepAlive(true));
 client.getNow(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, onSuccess(resp1 -> {
  // Response is paused but request is put back in the pool since the HTTP response fully arrived
  // but the response it's not yet delivered to the application as we pause the response
  resp1.pause();
  // Do a request on the same connection
  client.getNow(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, onSuccess(resp2 -> {
   resp2.bodyHandler(body2 -> {
    // When the response arrives -> resume the first request
    assertEquals("HelloWorld2", body2.toString());
    resp1.bodyHandler(body1 -> {
     assertEquals("HelloWorld1", body1.toString());
     testComplete();
    });
    resp1.resume();
   });
  }));
 }));
 await();
}
origin: gravitee-io/gravitee-gateway

  @Override
  public ReadStream<Buffer> resume() {
    if (httpClientResponse != null) {
      httpClientResponse.resume();
    } else {
      endHandler.handle(null);
    }
    return null;
  }
}
origin: eclipse-vertx/vert.x

@Test
public void testClearPausedBuffersWhenResponseEnds() throws Exception {
 Buffer data = TestUtils.randomBuffer(20);
 int num = 10;
 waitFor(num);
 server.requestHandler(req -> {
  req.response().end(data);
 });
 startServer();
 client.close();
 client = vertx.createHttpClient(createBaseClientOptions().setMaxPoolSize(1).setKeepAlive(true));
 for (int i = 0;i < num;i++) {
  client.request(HttpMethod.GET, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, onSuccess(resp -> {
   resp.bodyHandler(buff -> {
    assertEquals(data, buff);
    complete();
   });
   resp.pause();
   vertx.setTimer(10, id -> {
    resp.resume();
   });
  })).end();
 }
 await();
}
origin: io.vertx/vertx-core

@Test
public void testServerDrainHandler() {
 drainingServer(resumeFuture -> {
  client.request(HttpMethod.GET, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, resp -> {
   resp.pause();
   resumeFuture.setHandler(ar -> resp.resume());
  }).end();
 });
 await();
}
origin: io.vertx/vertx-core

 vertx.setTimer(500, id -> {
  paused.set(false);
  resp.resume();
 });
});
origin: io.vertx/vertx-core

@Test
public void testHttpClientResumeConnectionOnResponseOnLastMessage() throws Exception {
 server.requestHandler(req -> req.response().end("ok"));
 startServer();
 client.close();
 client = vertx.createHttpClient(new HttpClientOptions().setKeepAlive(true).setMaxPoolSize(1));
 client.getNow(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, resp1 -> {
  resp1.pause();
  // The connection resume is asynchronous and the end message will be received before connection resume happens
  resp1.resume();
  client.getNow(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, resp2 -> {
   testComplete();
  });
 });
 await();
}
origin: io.vertx/vertx-core

   testComplete();
  });
  resp.resume();
 });
});
origin: apiman/apiman

@Override
public void transmit() {
  logger.debug("Resuming");
  clientResponse.resume();
}
origin: io.gravitee.gateway.http/gravitee-gateway-http-client-vertx

  @Override
  public ReadStream<Buffer> resume() {
    if (httpClientResponse != null) {
      httpClientResponse.resume();
    } else {
      endHandler.handle(null);
    }
    return null;
  }
}
origin: io.gravitee.gateway/gravitee-gateway-http

  @Override
  public ReadStream<Buffer> resume() {
    if (httpClientResponse != null) {
      httpClientResponse.resume();
    } else {
      endHandler.handle(null);
    }
    return null;
  }
}
origin: io.vertx/vertx-core

 resp.pause();
 vertx.setTimer(1, id -> {
  resp.resume();
 });
});
origin: io.vertx/vertx-core

 });
 whenFull.setHandler(v -> {
  resp.resume();
 });
});
origin: io.vertx/vertx-core

@Test
public void testHttpClientResponseBufferedWithPausedEnd() throws Exception {
 AtomicInteger i = new AtomicInteger();
 server.requestHandler(req -> {
  req.response().end("HelloWorld" + i.incrementAndGet());
 });
 startServer();
 client.close();
 client = vertx.createHttpClient(new HttpClientOptions().setMaxPoolSize(1).setKeepAlive(true));
 client.getNow(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, resp1 -> {
  // Response is paused but request is put back in the pool since the HTTP response fully arrived
  // but the response it's not yet delivered to the application as we pause the response
  resp1.pause();
  // Do a request on the same connection
  client.getNow(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, resp2 -> {
   resp2.bodyHandler(body2 -> {
    // When the response arrives -> resume the first request
    assertEquals("HelloWorld2", body2.toString());
    resp1.bodyHandler(body1 -> {
     assertEquals("HelloWorld1", body1.toString());
     testComplete();
    });
    resp1.resume();
   });
  });
 });
 await();
}
origin: io.vertx/vertx-core

@Test
public void testClearPausedBuffersWhenResponseEnds() throws Exception {
 Buffer data = TestUtils.randomBuffer(20);
 int num = 10;
 waitFor(num);
 server.requestHandler(req -> {
  req.response().end(data);
 });
 startServer();
 client.close();
 client = vertx.createHttpClient(createBaseClientOptions().setMaxPoolSize(1).setKeepAlive(true));
 for (int i = 0;i < num;i++) {
  client.request(HttpMethod.GET, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, resp -> {
   resp.bodyHandler(buff -> {
    assertEquals(data, buff);
    complete();
   });
   resp.pause();
   vertx.setTimer(10, id -> {
    resp.resume();
   });
  }).end();
 }
 await();
}
io.vertx.core.httpHttpClientResponseresume

Popular methods of HttpClientResponse

  • statusCode
  • bodyHandler
    Convenience method for receiving the entire request body in one piece. This saves you having to manu
  • statusMessage
  • headers
  • exceptionHandler
  • endHandler
  • getHeader
    Return the first header value with the specified name
  • handler
  • pause
  • request
  • cookies
  • netSocket
    Get a net socket for the underlying connection of this request. USE THIS WITH CAUTION! Writing to th
  • cookies,
  • netSocket,
  • version,
  • customFrameHandler,
  • getTrailer,
  • streamPriorityHandler,
  • trailers,
  • fetch

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • JFileChooser (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now