public class ApacheAsyncClient extends Object implements AsyncClient
| Modifier and Type | Class and Description |
|---|---|
static class |
ApacheAsyncClient.Builder |
| Modifier and Type | Field and Description |
|---|---|
protected RequestConfigFactory |
configFactory |
| Constructor and Description |
|---|
ApacheAsyncClient(Config config) |
ApacheAsyncClient(org.apache.http.nio.client.HttpAsyncClient client,
Config config) |
ApacheAsyncClient(org.apache.http.nio.client.HttpAsyncClient client,
Config config,
org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager manager,
AsyncIdleConnectionMonitorThread monitor)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static ApacheAsyncClient.Builder |
builder(org.apache.http.nio.client.HttpAsyncClient client) |
java.util.stream.Stream<Exception> |
close() |
org.apache.http.nio.client.HttpAsyncClient |
getClient() |
protected <T> void |
handleError(Config config,
HttpResponse<T> httpResponse) |
boolean |
isRunning() |
void |
registerShutdownHook()
Register the Async clients with shutdown hooks
|
<T> CompletableFuture<HttpResponse<T>> |
request(HttpRequest request,
java.util.function.Function<RawResponse,HttpResponse<T>> transformer,
CompletableFuture<HttpResponse<T>> callback)
Make a Async request
|
void |
setConfigFactory(RequestConfigFactory configFactory) |
protected org.apache.http.client.CredentialsProvider |
toApacheCreds(Proxy proxy) |
protected <T> HttpResponse<T> |
transformBody(java.util.function.Function<RawResponse,HttpResponse<T>> transformer,
RawResponse rr) |
protected RequestConfigFactory configFactory
public ApacheAsyncClient(Config config)
public ApacheAsyncClient(org.apache.http.nio.client.HttpAsyncClient client,
Config config)
@Deprecated public ApacheAsyncClient(org.apache.http.nio.client.HttpAsyncClient client, Config config, org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager manager, AsyncIdleConnectionMonitorThread monitor)
public void registerShutdownHook()
AsyncClientregisterShutdownHook in interface AsyncClientpublic <T> CompletableFuture<HttpResponse<T>> request(HttpRequest request, java.util.function.Function<RawResponse,HttpResponse<T>> transformer, CompletableFuture<HttpResponse<T>> callback)
AsyncClientrequest in interface AsyncClientT - 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 AsyncClientpublic org.apache.http.nio.client.HttpAsyncClient getClient()
getClient in interface AsyncClientpublic java.util.stream.Stream<Exception> close()
close in interface AsyncClientpublic static ApacheAsyncClient.Builder builder(org.apache.http.nio.client.HttpAsyncClient client)
protected org.apache.http.client.CredentialsProvider toApacheCreds(Proxy proxy)
protected <T> HttpResponse<T> transformBody(java.util.function.Function<RawResponse,HttpResponse<T>> transformer, RawResponse rr)
protected <T> void handleError(Config config, HttpResponse<T> httpResponse)
public void setConfigFactory(RequestConfigFactory configFactory)
Copyright © 2019. All rights reserved.