congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
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

  • Finding current android device location
  • requestLocationUpdates (LocationManager)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • Kernel (java.awt.image)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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