Package org.eclipse.jetty.client.api
Interface Response.AsyncContentListener
- All Superinterfaces:
EventListener
,Response.DemandedContentListener
,Response.ResponseListener
- All Known Subinterfaces:
Response.ContentListener
,Response.Listener
- All Known Implementing Classes:
AsyncMiddleManServlet.ProxyResponseListener
,BufferingResponseListener
,ContinueProtocolHandler.ContinueListener
,FutureResponseListener
,InputStreamResponseListener
,ProxyServlet.ProxyResponseListener
,RedirectProtocolHandler
,Response.Listener.Adapter
- Enclosing interface:
- Response
Asynchronous listener for the response content events.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onContent
(Response response, ByteBuffer content, Callback callback) Callback method invoked when the response content has been received, parsed and there is demand.default void
onContent
(Response response, LongConsumer demand, ByteBuffer content, Callback callback) Callback method invoked when the response content has been received.Methods inherited from interface org.eclipse.jetty.client.api.Response.DemandedContentListener
onBeforeContent
-
Method Details
-
onContent
Callback method invoked when the response content has been received, parsed and there is demand. Thecallback
object should be succeeded to signal that thecontent
buffer has been consumed and to demand more content.- Parameters:
response
- the response containing the response line data and the headerscontent
- the content bytes receivedcallback
- the callback to call when the content is consumed and to demand more content
-
onContent
default void onContent(Response response, LongConsumer demand, ByteBuffer content, Callback callback) Description copied from interface:Response.DemandedContentListener
Callback method invoked when the response content has been received. Thecallback
object should be succeeded to signal that thecontent
buffer has been consumed. Thedemand
object should be used to demand more content, similarly toFlow.Subscription.request(long)
.- Specified by:
onContent
in interfaceResponse.DemandedContentListener
- Parameters:
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 consumed
-