org.apache.hc.core5.http.nio

## Interface AsyncEntityConsumer<T>

- Type Parameters:
    `T` - entity representation.
  All Superinterfaces:
    AsyncDataConsumer, ResourceHolder
  All Known Implementing Classes:
    AbstractBinAsyncEntityConsumer, AbstractCharAsyncEntityConsumer, AbstractClassicEntityConsumer, BasicAsyncEntityConsumer, DigestingEntityConsumer, NoopEntityConsumer, StringAsyncEntityConsumer

      public interface AsyncEntityConsumer<T>
      extends AsyncDataConsumer

  Abstract asynchronous message entity consumer.
  Since:
    5.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `failed(Exception cause)` Triggered to signal a failure in data processing.
    `T` | `getContent()` Returns the result of entity processing when it becomes available or `null` if the entity is still being received.
    `void` | `streamStart(EntityDetails entityDetails, FutureCallback<T> resultCallback)` Signals beginning of an incoming request entity stream.

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

    - #### streamStart

          void streamStart(EntityDetails entityDetails,
                         FutureCallback<T> resultCallback)
                           throws HttpException,
                                  IOException

      Signals beginning of an incoming request entity stream.
      Parameters:
        `entityDetails` - the details of the incoming message entity.
        `resultCallback` - the result callback.
      Throws:
        `HttpException`
        `IOException`

    - #### failed

          void failed(Exception cause)

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

    - #### getContent

          T getContent()

      Returns the result of entity processing when it becomes available or `null` if the entity is still being received.
      Returns:
        the response processing result.

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