I use the pier, version 7.0.1, if that matters.
Sometimes I have some rather lengthy tasks on the server that I would like to cancel / stop if the client disconnects (in the case of GET requests, and not, for example, downloading POST files). This does not seem to be the case, and these tasks continue to be completed.
Perhaps I can use the ServletRequestListener.requestDestoryed listener to receive notifications of such tasks, but what is the recommended approach to stop the flow of requests? Regarding the release of resources, such as connecting to a database, accessing files, or performing tasks (executor service)?
What is the recommended approach to stopping such tasks as soon as possible?
source
share