org.apache.hc.core5.http.nio

## Interface AsyncRequestConsumer<T>

- Type Parameters:
    `T` - request representation.
  All Superinterfaces:
    AsyncDataConsumer, ResourceHolder
  All Known Implementing Classes:
    AbstractAsyncRequesterConsumer, BasicRequestConsumer

      public interface AsyncRequestConsumer<T>
      extends AsyncDataConsumer

  Abstract asynchronous request consumer.
  Since:
    5.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `consumeRequest(HttpRequest request, EntityDetails entityDetails, HttpContext context, FutureCallback<T> resultCallback)` Triggered to signal receipt of a request message head.
    `void` | `failed(Exception cause)` Triggered to signal a failure in data processing.

    - ### Methods inherited from interface org.apache.hc.core5.http.nio.AsyncDataConsumer

      `consume, streamEnd, updateCapacity`

    - ### Methods inherited from interface org.apache.hc.core5.http.nio.ResourceHolder

      `releaseResources`

- - ### Method Detail

    - #### consumeRequest

          void consumeRequest(HttpRequest request,
                            EntityDetails entityDetails,
                            HttpContext context,
                            FutureCallback<T> resultCallback)
                              throws HttpException,
                                     IOException

      Triggered to signal receipt of a request message head.
      Parameters:
        `request` - the request message head.
        `entityDetails` - the request entity details or `null` if the request does not enclose an entity.
        `context` - the actual execution context.
        `resultCallback` - the result callback called when request processing has been completed successfully or unsuccessfully.
      Throws:
        `HttpException`
        `IOException`

    - #### failed

          void failed(Exception cause)

      Triggered to signal a failure in data processing.
      Parameters:
        `cause` - the cause of the failure.

Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.