org.apache.hc.core5.http.nio

## Interface AsyncRequestProducer

- All Superinterfaces:
    AsyncDataProducer, ResourceHolder
  All Known Implementing Classes:
    BasicRequestProducer

      public interface AsyncRequestProducer
      extends AsyncDataProducer

  Abstract asynchronous request producer.
  Since:
    5.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `failed(Exception cause)` Triggered to signal a failure in data generation.
    `boolean` | `isRepeatable()` Determines whether the producer can consistently produce the same content after invocation of `ResourceHolder.releaseResources()`.
    `void` | `sendRequest(RequestChannel channel, HttpContext context)` Triggered to signal the ability of the underlying request channel to accept a request messages.

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

      `available, produce`

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

      `releaseResources`

- - ### Method Detail

    - #### sendRequest

          void sendRequest(RequestChannel channel,
                         HttpContext context)
                           throws HttpException,
                                  IOException

      Triggered to signal the ability of the underlying request channel to accept a request messages. The data producer can choose to send a request message immediately inside the call or asynchronously at some later point.
      Parameters:
        `channel` - the request channel capable to accepting a request message.
        `context` - the actual execution context.
      Throws:
        `HttpException`
        `IOException`

    - #### isRepeatable

          boolean isRepeatable()

      Determines whether the producer can consistently produce the same content after invocation of `ResourceHolder.releaseResources()`.

    - #### failed

          void failed(Exception cause)

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

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