public class ApacheAsyncClient extends Object implements AsyncClient
Constructor and Description |
---|
ApacheAsyncClient(Config config) |
ApacheAsyncClient(org.apache.http.nio.client.HttpAsyncClient client,
Config config,
org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager manager,
AsyncIdleConnectionMonitorThread monitor) |
Modifier and Type | Method and Description |
---|---|
java.util.stream.Stream<Exception> |
close() |
org.apache.http.nio.client.HttpAsyncClient |
getClient() |
protected org.apache.http.client.config.RequestConfig |
getRequestConfig(Config config) |
boolean |
isRunning() |
<T> CompletableFuture<HttpResponse<T>> |
request(HttpRequest request,
java.util.function.Function<RawResponse,HttpResponse<T>> transformer,
CompletableFuture<HttpResponse<T>> callback)
Make a Async request
|
protected org.apache.http.client.CredentialsProvider |
toApacheCreds(Proxy proxy) |
public ApacheAsyncClient(Config config)
public ApacheAsyncClient(org.apache.http.nio.client.HttpAsyncClient client, Config config, org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager manager, AsyncIdleConnectionMonitorThread monitor)
public <T> CompletableFuture<HttpResponse<T>> request(HttpRequest request, java.util.function.Function<RawResponse,HttpResponse<T>> transformer, CompletableFuture<HttpResponse<T>> callback)
AsyncClient
request
in interface AsyncClient
T
- The type of the bodyrequest
- the prepared request objecttransformer
- the function to transform the responsecallback
- the CompletableFuture that will handle the eventual responsepublic boolean isRunning()
isRunning
in interface AsyncClient
public org.apache.http.nio.client.HttpAsyncClient getClient()
getClient
in interface AsyncClient
public java.util.stream.Stream<Exception> close()
close
in interface AsyncClient
protected org.apache.http.client.config.RequestConfig getRequestConfig(Config config)
protected org.apache.http.client.CredentialsProvider toApacheCreds(Proxy proxy)
Copyright © 2019. All rights reserved.