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

## Class MinimalHttpAsyncClient

- java.lang.Object
- - org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient
  - - org.apache.hc.client5.http.impl.async.MinimalHttpAsyncClient

- All Implemented Interfaces:
    Closeable, AutoCloseable, HttpAsyncClient, org.apache.hc.core5.io.ModalCloseable

      @Contract(threading=SAFE_CONDITIONAL)
      public final class MinimalHttpAsyncClient
      extends CloseableHttpAsyncClient

  Minimal implementation of `CloseableHttpAsyncClient`. This client is optimized for HTTP/1.1 and HTTP/2 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 executed by this client will get assigned to separate connections leased from the connection pool.

  Since:
    5.0

- - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `awaitShutdown(org.apache.hc.core5.util.TimeValue waitTime)`
    `void` | `close()`
    `void` | `close(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)`
    `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)`
    `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)` Deprecated. Use `RequestRouter` at the construction time
    `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

    - #### lease

          public 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)

    - #### lease

          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)

    - #### 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)

    - #### 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:
        `doExecute` in class `CloseableHttpAsyncClient`

    - #### 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:
        `start` in class `CloseableHttpAsyncClient`

    - #### register

          @Deprecated
          public void register(String hostname,
                                           String uriPattern,
                                           org.apache.hc.core5.function.Supplier<org.apache.hc.core5.http.nio.AsyncPushConsumer> supplier)

      Deprecated. Use `RequestRouter` at the construction time
      Specified by:
        `register` in class `CloseableHttpAsyncClient`

    - #### getStatus

          public final org.apache.hc.core5.reactor.IOReactorStatus getStatus()

      Specified by:
        `getStatus` in class `CloseableHttpAsyncClient`

    - #### awaitShutdown

          public final void awaitShutdown(org.apache.hc.core5.util.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(org.apache.hc.core5.io.CloseMode closeMode)

    - #### close

          public void close()

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.