I have some queries made by GWT (2.4) RequestBuilder that might take a long time to execute. In these cases I’d like to allow the user cancelling the request. As it is only a query aborting the processing on the server side would not have any harmful side-effect. Even the wasted server side CPU cycles do not matter if the solution involves any. Here is an example of the situation:
RequestBuilder requestBuilder = new RequestBuilder(
RequestBuilder.GET, FOOBAR_SERVICE_URL);
requestBuilder.sendRequest("",
new RequestCallback<ResultList>() { .... });
// I'd like to cancel the request when a Cancel button is pressed
Do you have any idea how to do this?
sendRequest()method ofRequestBuilderreturns instanceRequestclass, which hascancel()method,which allows you to cancel request.E.g.