@Contract(threading=SAFE_CONDITIONAL) public final class MinimalH2AsyncClient extends CloseableHttpAsyncClient
CloseableHttpAsyncClient. This client
is optimized for HTTP/2 multiplexing message transport and does not support advanced
HTTP protocol functionality such as request execution via a proxy, state management,
authentication and request redirects.
Concurrent message exchanges with the same connection route executed by this client will get automatically multiplexed over a single physical HTTP/2 connection.
| Modifier and Type | Method and Description |
|---|---|
void |
awaitShutdown(org.apache.hc.core5.util.TimeValue waitTime) |
void |
close() |
org.apache.hc.core5.concurrent.Cancellable |
execute(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler) |
org.apache.hc.core5.concurrent.Cancellable |
execute(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler,
org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory,
org.apache.hc.core5.http.protocol.HttpContext context) |
<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.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory,
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.
|
org.apache.hc.core5.reactor.IOReactorStatus |
getStatus() |
void |
initiateShutdown() |
void |
register(String hostname,
String uriPattern,
org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier) |
void |
shutdown(org.apache.hc.core5.io.CloseMode closeMode) |
void |
start() |
public org.apache.hc.core5.concurrent.Cancellable execute(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler,
org.apache.hc.core5.http.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory,
org.apache.hc.core5.http.protocol.HttpContext context)
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.nio.HandlerFactory<org.apache.hc.core5.http.nio.AsyncPushConsumer> pushHandlerFactory, 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.pushHandlerFactory - the push handler factory. Optional and may be null.context - HTTP context. Optional and may be null.callback - future callback. Optional and may be null.public final org.apache.hc.core5.concurrent.Cancellable execute(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler)
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)
register in class CloseableHttpAsyncClientpublic final org.apache.hc.core5.reactor.IOReactorStatus getStatus()
getStatus 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.CloseMode closeMode)
shutdown in class CloseableHttpAsyncClientpublic void close()
Copyright © 1999–2019 The Apache Software Foundation. All rights reserved.