In my GWT code I tend to end up with AsyncCallbacks all over the place so that I can support data which is fetched via RPC in all my widgets. It seems to be a commonplace issue that I forget to call the callback, which can be quite difficult to diagnose. To help with that I create a class which “times out” an AsyncCallback. You wrap your AsyncCallback in this object and then you’ll get an error back if no failure or success comes back in a timely fashion.

December 18, 2007 at 5:36 am |
Hi!, Can you post your class code?
Thanks,
Johann
December 18, 2007 at 10:21 am |
Ah yes … for some reason all the code got lost in the post, I seem to be having issues with WordPress. I’ve posted a ZIP file instead.
May 26, 2008 at 2:00 am |
Sorry, I’m a newbie
I don’t understand how to use your classes,
what do you intend for ” wrap your AsyncCallback in this object..”
Thanks!
Mark
May 26, 2008 at 1:15 pm |
By “wrap” I mean you take code that currently does something like:
myCallback = new AsyncCallback() { … };
something.doSomeAsyncOperation(myCallback);
and replace the callback object with a replacement like this:
myCallback = new AsyncCallback() { … };
myCallback = new AsyncCallbackWithTimeout(myCallback);
something.doSomeAsyncOperation(myCallback);
Since the calls to the original callback are going “through” the timeout class, this is called a wrapper. Hope that helps.
May 27, 2008 at 5:26 am |
It works good
Thank you for your help
June 18, 2009 at 12:18 am |
Hello, I am interested by your class TimeOut but the link does not work you can show us the class code
Thank you for advances.
June 18, 2009 at 7:41 am |
The code is now available as part of the kiyaa project on googlecode.
http://code.google.com/p/kiyaa/
June 18, 2009 at 11:42 pm |
Thank you.
July 26, 2009 at 2:00 pm |
Ahaan… I will follow.