Module org.eclipse.jetty.client
Package org.eclipse.jetty.client.api
Interface Request.Content.Subscription
-
- All Known Implementing Classes:
AbstractRequestContent.AbstractSubscription,AsyncRequestContent,OutputStreamRequestContent
- Enclosing interface:
- Request.Content
public static interface Request.Content.SubscriptionThe 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 viafail(Throwable).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddemand()Demands more content, which eventually results inRequest.Content.Consumer.onContent(ByteBuffer, boolean, Callback)to be invoked.default voidfail(java.lang.Throwable failure)Fails the subscription, notifying the content producer to stop producing content.
-
-
-
Method Detail
-
demand
void demand()
Demands more content, which eventually results in
Request.Content.Consumer.onContent(ByteBuffer, boolean, Callback)to be invoked.
-
fail
default void fail(java.lang.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.
- Parameters:
failure- the reason of the failure
-
-