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

## Class EarlyHintsAsyncExec

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

All Implemented Interfaces:
  AsyncExecChainHandler

    public final class EarlyHintsAsyncExec
    extends Object
    implements AsyncExecChainHandler

Execution chain handler that delivers `103 Early Hints` informational responses to a user-provided `EarlyHintsListener` without affecting processing of the final (non-1xx) response.

This handler forwards each `103` informational response to the listener. All other responses (including the final response) are delegated unchanged.

For security and interoperability, applications typically act only on headers considered safe in Early Hints (for example, `Link` with `rel=preload` or `rel=preconnect`).

Since:
  5.6
See Also:
  `EarlyHintsListener`, `HttpStatus.SC_EARLY_HINTS`, `ResponseChannel.sendInformation(org.apache.hc.core5.http.HttpResponse, org.apache.hc.core5.http.protocol.HttpContext)`

### Constructor Summary

Constructors
Constructor and Description
`EarlyHintsAsyncExec(EarlyHintsListener listener)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `execute(HttpRequest request, AsyncEntityProducer entityProducer, AsyncExecChain.Scope scope, AsyncExecChain chain, AsyncExecCallback callback)` Executes the actual HTTP request.

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

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

### Constructor Detail

#### EarlyHintsAsyncExec

    public EarlyHintsAsyncExec(EarlyHintsListener listener)

### Method Detail

#### execute

    public void execute(HttpRequest request,
                        AsyncEntityProducer entityProducer,
                        AsyncExecChain.Scope scope,
                        AsyncExecChain chain,
                        AsyncExecCallback callback)
                 throws HttpException,
                        IOException

Description copied from interface: `AsyncExecChainHandler`
Executes the actual HTTP request. The handler can choose to return a response message immediately inside the call or asynchronously at some later point or delegate request execution to the next element in the execution chain.

Specified by:
  `execute` in interface `AsyncExecChainHandler`
Parameters:
  `request` - the actual request.
  `entityProducer` - the request entity producer or `null` if the request does not enclose an entity.
  `scope` - the execution scope .
  `chain` - the next element in the request execution chain.
  `callback` - the execution callback.
Throws:
  `HttpException` - If a protocol error occurs.
  `IOException` - If an I/O error occurs.