I am learning rest with spring mvc/boot. I understand basic rest calls but i am having trouble understanding long running/non-blocking rest calls.
I understand that with long running rest calls we start a separate thread and the server returns a DeferredResult object to client but how does a client is notified when the processing thread is completed ?
Can someone provide me an example on how to handle this at clients end ?
Also how the non-java clients can handle such request ?
Web was not built for long running tasks, it was purely request/response. However, you can use Server Sent Events for notification back to the client or use Websockets. Spring supports both.
https://github.com/cedricziel/demo-sse-spring-boot
https://spring.io/guides/gs/messaging-stomp-websocket/