Class MinimalH2AsyncClient
java.lang.Object
org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient
org.apache.hc.client5.http.impl.async.MinimalH2AsyncClient
- All Implemented Interfaces:
Closeable, AutoCloseable, HttpAsyncClient, org.apache.hc.core5.io.ModalCloseable
@Contract(threading=SAFE_CONDITIONAL)
public final class MinimalH2AsyncClient
extends CloseableHttpAsyncClient
Minimal implementation of HTTP/2 only
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.
- Since:
- 5.0
-
Method Summary
Modifier and TypeMethodDescriptionfinal voidawaitShutdown(org.apache.hc.core5.util.TimeValue waitTime) voidclose()final voidclose(org.apache.hc.core5.io.CloseMode closeMode) protected <T> Future<T> doExecute(org.apache.hc.core5.http.HttpHost httpHost, 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) final org.apache.hc.core5.concurrent.Cancellableexecute(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler) org.apache.hc.core5.concurrent.Cancellableexecute(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) final org.apache.hc.core5.reactor.IOReactorStatusfinal voidvoidregister(String hostname, String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier) voidsetConnectionConfigResolver(org.apache.hc.core5.function.Resolver<org.apache.hc.core5.http.HttpHost, ConnectionConfig> connectionConfigResolver) SetsResolverforConnectionConfigon a per host basis.final voidstart()
-
Method Details
-
execute
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) -
setConnectionConfigResolver
public void setConnectionConfigResolver(org.apache.hc.core5.function.Resolver<org.apache.hc.core5.http.HttpHost, ConnectionConfig> connectionConfigResolver) SetsResolverforConnectionConfigon a per host basis.- Since:
- 5.2
-
doExecute
protected <T> Future<T> doExecute(org.apache.hc.core5.http.HttpHost httpHost, 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) - Specified by:
doExecutein classCloseableHttpAsyncClient
-
execute
public final org.apache.hc.core5.concurrent.Cancellable execute(org.apache.hc.core5.http.nio.AsyncClientExchangeHandler exchangeHandler) -
start
public final void start()- Specified by:
startin classCloseableHttpAsyncClient
-
register
public void register(String hostname, String uriPattern, org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier) - Specified by:
registerin classCloseableHttpAsyncClient
-
getStatus
public final org.apache.hc.core5.reactor.IOReactorStatus getStatus()- Specified by:
getStatusin classCloseableHttpAsyncClient
-
awaitShutdown
public final void awaitShutdown(org.apache.hc.core5.util.TimeValue waitTime) throws InterruptedException - Specified by:
awaitShutdownin classCloseableHttpAsyncClient- Throws:
InterruptedException
-
initiateShutdown
public final void initiateShutdown()- Specified by:
initiateShutdownin classCloseableHttpAsyncClient
-
close
public final void close(org.apache.hc.core5.io.CloseMode closeMode) -
close
public void close()
-