Is there a annotation or something in spring-mvc which lets me call something as soon as a client closes connection or cancels a request in any way? I got a rest service which is normally very quick but can dependent on user input go for some seconds. I want to cancel the processing on server side as soon as the client breaks its connection.
I could implement something where the client has to poll from time to time to get results but I want to cancel the process when the client closes its browser for example or just cancels a curl request. Any hook provided by spring here?