Interface Response.AsyncContentListener
- All Superinterfaces:
EventListener, Response.ContentSourceListener, Response.ResponseListener
- All Known Subinterfaces:
Response.ContentListener, Response.Listener
- All Known Implementing Classes:
AsyncMiddleManServlet.ProxyResponseListener, AsyncMiddleManServlet.ProxyResponseListener, AsyncMiddleManServlet.ProxyResponseListener, BufferingResponseListener, CompletableResponseListener, ContinueProtocolHandler.ContinueListener, FutureResponseListener, InputStreamResponseListener, PathResponseListener, ProxyHandler.ProxyResponseListener, ProxyServlet.ProxyResponseListener, ProxyServlet.ProxyResponseListener, ProxyServlet.ProxyResponseListener, RedirectProtocolHandler
- Enclosing interface:
Response
Asynchronous listener for the response content events.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidonContent(Response response, Content.Chunk chunk, Runnable demander) Callback method invoked when the response content has been received, parsed and there is demand.default voidonContentSource(Response response, Content.Source contentSource) Callback method invoked when all the response headers have been received and parsed.
-
Method Details
-
onContent
Callback method invoked when the response content has been received, parsed and there is demand. Thechunkmust be consumed, copied, or retained before returning from this method as it is then automatically released. Thedemandermust be run before this method may be invoked again.- Parameters:
response- the response containing the response line data and the headerschunk- the chunk receiveddemander- the runnable to be run to demand the next chunk- Throws:
Exception- an uncaught exception will abort the response, release the chunk and fail the content source from which the chunk was read from
-
onContentSource
Description copied from interface:Response.ContentSourceListenerCallback method invoked when all the response headers have been received and parsed. It is responsible for driving thecontentSourceinstance with a read/demand loop. Note that this is not invoked for interim statuses.- Specified by:
onContentSourcein interfaceResponse.ContentSourceListener- Parameters:
response- the response containing the response line data and the headerscontentSource- theContent.Sourcethat must be driven to read the data
-