Package org.eclipse.jetty.client.api
Interface Request.Content.Subscription
- All Known Implementing Classes:
AbstractRequestContent.AbstractSubscription,AsyncRequestContent,OutputStreamRequestContent,RequestContentAdapter
- Enclosing interface:
- Request.Content
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 Summary
Modifier and TypeMethodDescriptionvoiddemand()Demands more content, which eventually results inRequest.Content.Consumer.onContent(ByteBuffer, boolean, Callback)to be invoked.default voidFails the subscription, notifying the content producer to stop producing content.
-
Method Details
-
demand
void demand()Demands more content, which eventually results in
Request.Content.Consumer.onContent(ByteBuffer, boolean, Callback)to be invoked. -
fail
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
-