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) |
Stream<Exception> |
close() |
protected static org.apache.http.HttpHost |
determineTarget(org.apache.http.client.methods.HttpUriRequest request,
Headers headers) |
org.apache.http.nio.client.HttpAsyncClient |
getClient() |
boolean |
isRunning() |
void |
registerShutdownHook()
Register the Async clients with shutdown hooks
|
<T> CompletableFuture<HttpResponse<T>> |
request(HttpRequest request,
Function<RawResponse,HttpResponse<T>> transformer,
CompletableFuture<HttpResponse<T>> callback)
Make a Async request
|
void |
setConfigFactory(RequestConfigFactory configFactory) |
protected <T> HttpResponse<T> |
transformBody(Function<RawResponse,HttpResponse<T>> transformer,
RawResponse rr) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrequestprotected 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, 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 Stream<Exception> close()
close in interface AsyncClientpublic static ApacheAsyncClient.Builder builder(org.apache.http.nio.client.HttpAsyncClient client)
protected <T> HttpResponse<T> transformBody(Function<RawResponse,HttpResponse<T>> transformer, RawResponse rr)
public void setConfigFactory(RequestConfigFactory configFactory)
protected static org.apache.http.HttpHost determineTarget(org.apache.http.client.methods.HttpUriRequest request,
Headers headers)
Copyright © 2020. All rights reserved.