HTTP request could be aborted on front-end at any time. At the moment I observe that my Spring application does not have a clue about this fact until I start writing the response to the wire. At the same time knowing that the request was aborted beforehand I could stop doing useless job by supporting cooperative cancellation.
ASP.NET has an implementation of request cancellation based on CancellationToken. I am looking for something similar for Spring but cannot find anything. I understand that CancellationToken gets particulary useful with async/await pattern but even without async/await it could have been useful.
So two questions:
- Does
Spring MVChave this featre? - If not, how its absence is typically worked-around? Of course, I could add another REST endpoint to notify the back-end that the request was cancelled, but this is a bit awkward. It's like re-inventing the concept that is already supported on protocol level.
And two bonus questions (in case the answer to Q1 is No):
- Does
Springteam have plans for supporting it? - Did they ever give any comments why this was not supported?
Thanks.