public final class MinimalHttpAsyncClient extends CloseableHttpAsyncClient
| Modifier and Type | Method and Description |
|---|---|
void |
awaitShutdown(org.apache.hc.core5.util.TimeValue waitTime) |
void |
close() |
<T> Future<T> |
execute(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer,
org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer,
org.apache.hc.core5.http.protocol.HttpContext context,
org.apache.hc.core5.concurrent.FutureCallback<T> callback)
Initiates asynchronous HTTP request execution using the given context.
|
<T extends org.apache.hc.core5.http.nio.AsyncClientExchangeHandler> |
execute(T exchangeHandler,
org.apache.hc.core5.http.protocol.HttpContext context,
org.apache.hc.core5.concurrent.FutureCallback<T> callback) |
List<org.apache.hc.core5.reactor.ExceptionEvent> |
getExceptionLog() |
org.apache.hc.core5.reactor.IOReactorStatus |
getStatus() |
void |
initiateShutdown() |
Future<org.apache.hc.core5.http.nio.AsyncClientEndpoint> |
lease(org.apache.hc.core5.http.HttpHost host,
org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.http.nio.AsyncClientEndpoint> callback) |
Future<org.apache.hc.core5.http.nio.AsyncClientEndpoint> |
lease(org.apache.hc.core5.http.HttpHost host,
org.apache.hc.core5.http.protocol.HttpContext context,
org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.http.nio.AsyncClientEndpoint> callback) |
void |
register(String hostname,
String uriPattern,
org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier)
Registers
AsyncPushConsumer for the given host and the URI pattern. |
void |
shutdown(org.apache.hc.core5.io.ShutdownType shutdownType) |
void |
start() |
execute, execute, execute, registerpublic final Future<org.apache.hc.core5.http.nio.AsyncClientEndpoint> lease(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.http.nio.AsyncClientEndpoint> callback)
public Future<org.apache.hc.core5.http.nio.AsyncClientEndpoint> lease(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.http.nio.AsyncClientEndpoint> callback)
public final <T> Future<T> execute(org.apache.hc.core5.http.nio.AsyncRequestProducer requestProducer, org.apache.hc.core5.http.nio.AsyncResponseConsumer<T> responseConsumer, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)
HttpAsyncClientThe request producer passed to this method will be used to generate a request message and stream out its content without buffering it in memory. The response consumer passed to this method will be used to process a response message without buffering its content in memory.
Please note it may be unsafe to interact with the context instance while the request is still being executed.
T - the result type of request execution.requestProducer - request producer callback.responseConsumer - response consumer callback.context - HTTP contextcallback - future callback.public final <T extends org.apache.hc.core5.http.nio.AsyncClientExchangeHandler> Future<T> execute(T exchangeHandler, org.apache.hc.core5.http.protocol.HttpContext context, org.apache.hc.core5.concurrent.FutureCallback<T> callback)
public final void start()
start in class CloseableHttpAsyncClientpublic void register(String hostname, String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier)
HttpAsyncClientAsyncPushConsumer for the given host and the URI pattern.hostname - the name of the host this consumer intended for.
Can be null if applies to all hostsuriPattern - URI request patternsupplier - supplier that will be used to supply a consumer instance
for the given combination of hostname and URI pattern.public final org.apache.hc.core5.reactor.IOReactorStatus getStatus()
getStatus in class CloseableHttpAsyncClientpublic final List<org.apache.hc.core5.reactor.ExceptionEvent> getExceptionLog()
getExceptionLog in class CloseableHttpAsyncClientpublic final void awaitShutdown(org.apache.hc.core5.util.TimeValue waitTime)
throws InterruptedException
awaitShutdown in class CloseableHttpAsyncClientInterruptedExceptionpublic final void initiateShutdown()
initiateShutdown in class CloseableHttpAsyncClientpublic final void shutdown(org.apache.hc.core5.io.ShutdownType shutdownType)
shutdown in class CloseableHttpAsyncClientpublic void close()
Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.