public static interface Response.DemandedContentListener extends Response.ResponseListener
Modifier and Type | Method and Description |
---|---|
default void |
onBeforeContent(Response response,
LongConsumer demand)
Callback method invoked before response content events.
|
void |
onContent(Response response,
LongConsumer demand,
ByteBuffer content,
Callback callback)
Callback method invoked when the response content has been received.
|
default void onBeforeContent(Response response, LongConsumer demand)
demand
object should be used to demand content, otherwise
the demand remains at zero (no demand) and
onContent(Response, LongConsumer, ByteBuffer, Callback)
will
not be invoked even if content has been received and parsed.response
- the response containing the response line data and the headersdemand
- the object that allows to demand content buffersvoid onContent(Response response, LongConsumer demand, ByteBuffer content, Callback callback)
callback
object should be succeeded to signal that the
content
buffer has been consumed.
The demand
object should be used to demand more content,
similarly to ReactiveStreams's Subscription#request(long)
.response
- the response containing the response line data and the headersdemand
- the object that allows to demand content bufferscontent
- the content bytes receivedcallback
- the callback to call when the content is consumedCopyright © 2010 - 2020 Adobe. All Rights Reserved