Interface Request.Content.Subscription

All Known Implementing Classes:
AbstractRequestContent.AbstractSubscription, AsyncRequestContent, OutputStreamRequestContent, RequestContentAdapter
Enclosing interface:

public static interface Request.Content.Subscription

The link between a content producer and a content consumer.

Content consumers can demand more content via demand(), or ask the content producer to stop producing content via fail(Throwable).

  • Method Details

    • demand

      void demand()

      Demands more content, which eventually results in Request.Content.Consumer.onContent(ByteBuffer, boolean, Callback) to be invoked.

    • fail

      default void fail(Throwable failure)

      Fails the subscription, notifying the content producer to stop producing content.

      Typical failure: a proxy consumer waiting for more content (or waiting to demand content) that is failed by an error response from the server.

      failure - the reason of the failure