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, wait
request
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()
AsyncClient
registerShutdownHook
in interface AsyncClient
public <T> CompletableFuture<HttpResponse<T>> request(HttpRequest request, 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 Stream<Exception> close()
close
in interface AsyncClient
public 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 © 2021. All rights reserved.