org.apache.hc.client5.http.impl.async

## 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, ModalCloseable, ConnectionInitiator

    @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

All Methods Instance Methods Concrete Methods Deprecated Methods
`void` `awaitShutdown(TimeValue waitTime)`
`void` `close()`
`void` `close(CloseMode closeMode)`
`Future<IOSession>` `connect(NamedEndpoint remoteEndpoint, SocketAddress remoteAddress, SocketAddress localAddress, Timeout timeout, Object attachment, FutureCallback<IOSession> callback)`
`protected <T> Future<T>` `doExecute(HttpHost httpHost, AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, HttpContext context, FutureCallback<T> callback)`
`Cancellable` `execute(AsyncClientExchangeHandler exchangeHandler)`
`Cancellable` `execute(AsyncClientExchangeHandler exchangeHandler, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, HttpContext context)`
`IOReactorStatus` `getStatus()`
`void` `initiateShutdown()`
`void` `register(String hostname, String uriPattern, Supplier<AsyncPushConsumer> supplier)` Deprecated. Use `RequestRouter` at the construction time
`void` `setConnectionConfigResolver(Resolver<HttpHost,ConnectionConfig> connectionConfigResolver)` Sets `Resolver` for `ConnectionConfig` on a per host basis.
`void` `start()`

### Methods inherited from class org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient

`execute, execute, execute, execute, execute, execute, register`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### execute

    public Cancellable execute(AsyncClientExchangeHandler exchangeHandler,
                               HandlerFactory<AsyncPushConsumer> pushHandlerFactory,
                               HttpContext context)

#### setConnectionConfigResolver

    public void setConnectionConfigResolver(Resolver<HttpHost,ConnectionConfig> connectionConfigResolver)

Sets `Resolver` for `ConnectionConfig` on a per host basis.

Since:
  5.2

#### doExecute

    protected <T> Future<T> doExecute(HttpHost httpHost,
                                      AsyncRequestProducer requestProducer,
                                      AsyncResponseConsumer<T> responseConsumer,
                                      HandlerFactory<AsyncPushConsumer> pushHandlerFactory,
                                      HttpContext context,
                                      FutureCallback<T> callback)

Specified by:
  `doExecute` in class `CloseableHttpAsyncClient`

#### execute

    public final Cancellable execute(AsyncClientExchangeHandler exchangeHandler)

#### start

    public final void start()

Specified by:
  `start` in class `CloseableHttpAsyncClient`

#### register

    @Deprecated
    public void register(String hostname,
                                     String uriPattern,
                                     Supplier<AsyncPushConsumer> supplier)

Deprecated. Use `RequestRouter` at the construction time

Specified by:
  `register` in class `CloseableHttpAsyncClient`

#### connect

    public Future<IOSession> connect(NamedEndpoint remoteEndpoint,
                                     SocketAddress remoteAddress,
                                     SocketAddress localAddress,
                                     Timeout timeout,
                                     Object attachment,
                                     FutureCallback<IOSession> callback)

Specified by:
  `connect` in interface `ConnectionInitiator`

#### getStatus

    public final IOReactorStatus getStatus()

Specified by:
  `getStatus` in class `CloseableHttpAsyncClient`

#### awaitShutdown

    public final void awaitShutdown(TimeValue waitTime)
                             throws InterruptedException

Specified by:
  `awaitShutdown` in class `CloseableHttpAsyncClient`
Throws:
  `InterruptedException`

#### initiateShutdown

    public final void initiateShutdown()

Specified by:
  `initiateShutdown` in class `CloseableHttpAsyncClient`

#### close

    public final void close(CloseMode closeMode)

Specified by:
  `close` in interface `ModalCloseable`

#### close

    public void close()

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`