My code is for sending Emails to multiple users.User will click on send button,and rpc will be called. Now if user clicks on Cancel button .Ongoing rpc should be cancelled. . Can anyone help ?
I googled a lot, they have introduced the concept of Request Builder. But I am not getting any perfect idea.
Make your async method return a
Requestinstead ofvoidso you can callcancel()on it.— Source: https://developers.google.com/web-toolkit/doc/latest/DevGuideServerCommunication#DevGuideCreatingServices
FYI, you can also use
RequestBuilderas the return type, you’ll then have to call thesend()method by yourself (after possibly customizing the request, e.g. adding headers) to actually make the request to the server.And of course, if you need to tell the server to abort the processing, you’ll have to make another RPC call.