My favorites | Sign in
Project Logo
                
Search
for
Updated Mar 02, 2008 by piotr.dobrowolski
Labels: Featured
CancellableRequests  
New release of the library gives you the ability to cancel requests!

Introduction

Sometimes you just change your mind in the middle of an action. Now gwt-hermes gives you ability to cancel ongoing requests and move forward!

Details

Just change returned type from void to Cancellable in your async interface and call cancel method when you want to cancel the request.

Cancellable currentCall = testService.testMethod("aaaa", new AsyncCallback() {
	public void onFailure(Throwable caught) {
		Window.alert(caught.toString());
	}

	public void onSuccess(Object result) {
		/* do something here */
	}
});
//we change our minds here
currentCall.cancel();

Sign in to add a comment
Hosted by Google Code