Interface Response.AsyncContentListener

All Superinterfaces:
EventListener, Response.DemandedContentListener, Response.ResponseListener
All Known Subinterfaces:
Response.ContentListener, Response.Listener
All Known Implementing Classes:
BufferingResponseListener, ContinueProtocolHandler.ContinueListener, FutureResponseListener, InputStreamResponseListener, RedirectProtocolHandler, Response.Listener.Adapter
Enclosing interface:
Response

public static interface Response.AsyncContentListener extends Response.DemandedContentListener
Asynchronous listener for the response content events.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onContent(Response response, ByteBuffer content, org.eclipse.jetty.util.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, org.eclipse.jetty.util.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

      void onContent(Response response, ByteBuffer content, org.eclipse.jetty.util.Callback callback)
      Callback method invoked when the response content has been received, parsed and there is demand. The callback object should be succeeded to signal that the content buffer has been consumed and to demand more content.
      Parameters:
      response - the response containing the response line data and the headers
      content - the content bytes received
      callback - the callback to call when the content is consumed and to demand more content
    • onContent

      default void onContent(Response response, LongConsumer demand, ByteBuffer content, org.eclipse.jetty.util.Callback callback)
      Description copied from interface: Response.DemandedContentListener
      Callback method invoked when the response content has been received. The 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 Flow.Subscription.request(long).
      Specified by:
      onContent in interface Response.DemandedContentListener
      Parameters:
      response - the response containing the response line data and the headers
      demand - the object that allows to demand content buffers
      content - the content bytes received
      callback - the callback to call when the content is consumed