@Test public void testGet() throws Exception { Janus janus = new Janus( VIP_TEST, new ConstServerList(VIP_TEST, "http: new RandomLoadBalancer(), new ServerStatsFactory(ServerStats.class, new MetricRegistry())); try (AsyncHttpClient client = new AsyncHttpClient(janus, 0)) { ListenableFuture<HttpResponse> responseFuture = client.execute(new HttpRequest(HttpMethod.GET, null, null), "/"); HttpResponse response = responseFuture.get(5, TimeUnit.SECONDS); Assert.assertNotNull(response); } }
public ListenableFuture<HttpResponse> execute(HttpRequest request, String path, Object... urlVariables) throws IOException { SettableFuture<HttpResponse> response = SettableFuture.create(); executor.submit(new ExecuteTask(response, request, path, urlVariables, janus, httpClient, executor, numRetries)); return response; }
AsyncHttpClient implements Closeable { public ListenableFuture<HttpResponse> execute(HttpRequest request, String path, Object... urlVariables) throws IOException { SettableFuture<HttpResponse> response = SettableFuture.create(); executor.submit(new ExecuteTask(response, request, path, urlVariables, janus, httpClient, executor, numRetries)); return response; } }
AsyncHttpClient implements Closeable { public ListenableFuture<HttpResponse> execute(HttpRequest request, String path, Object... urlVariables) throws IOException { SettableFuture<HttpResponse> response = SettableFuture.create(); executor.submit(new ExecuteTask(response, request, path, urlVariables, janus, httpClient, executor, numRetries)); return response; } AsyncHttpClient(Janus janus, int numRetries); }
AsyncHttpClient implements Closeable { public ListenableFuture<HttpResponse> execute(HttpRequest request, String path, Object... urlVariables) throws IOException { SettableFuture<HttpResponse> response = SettableFuture.create(); executor.submit(new ExecuteTask(response, request, path, urlVariables, janus, httpClient, executor, numRetries)); return response; } AsyncHttpClient(Janus janus, int numRetries); void close(); ListenableFuture<HttpResponse> execute(HttpRequest request, String path, Object... urlVariables); }
AsyncHttpClient implements Closeable { public ListenableFuture<HttpResponse> execute(HttpRequest request, String path, Object... urlVariables) throws IOException { SettableFuture<HttpResponse> response = SettableFuture.create(); executor.submit(new ExecuteTask(response, request, path, urlVariables, janus, httpClient, executor, numRetries)); return response; } AsyncHttpClient(Janus janus, int numRetries); void close(); ListenableFuture<HttpResponse> execute(HttpRequest request, String path, Object... urlVariables);  }