org.apache.hc.client5.http.async

## Interface HttpAsyncClient

All Known Implementing Classes:
  CloseableHttpAsyncClient, MinimalHttpAsyncClient

    public interface HttpAsyncClient

This interface represents only the most basic contract for HTTP request execution. It imposes no restrictions or particular details on the request execution process and leaves the specifics of state management, authentication and redirect handling up to individual implementations.

Since:
  4.0

### Method Summary

Methods
`<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.
`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.

### Method Detail

#### execute

    <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.

The 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.

Type Parameters:
  `T` - the result type of request execution.
Parameters:
  `requestProducer` - request producer callback.
  `responseConsumer` - response consumer callback.
  `context` - HTTP context
  `callback` - future callback.
Returns:
  future representing pending completion of the operation.

#### register

    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.

Parameters:
  `hostname` - the name of the host this consumer intended for. Can be `null` if applies to all hosts
  `uriPattern` - URI request pattern
  `supplier` - supplier that will be used to supply a consumer instance for the given combination of hostname and URI pattern.