On Fri, Mar 25, 2011 at 9:09 AM, Antoine DESSAIGNE wrote:
> In fact, i don't see a single case where I would want to run the same
> Activity sometime in runAsync and sometime directly.

It's more that if you change your mind about what should run sync and
async, you shouldn't have to change your activity, because the
activity should still work the same.

I've attached my own, never-tested, attempt. Note that it assumes
you'll the methods in"the right order", but that can be changed
easily. It also switches to a permanent "failed" state if the runAsync
failed, but maybe it should re-attempt the runAsync in this case.
Finally, it was written before the AsyncProvider made it into GWT (and
GIN); the idea was that every subclass would implement doAsync as a
simple GWT.runAsync call (to create a split-point specific to the
subclass) and the createInstance() as a javax.inject.Provider::get().
The advantage compared to AsyncProvider is that you don't even create
the instance if the activity was cancelled before the fragment
finished loading.

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Attachment: ActivityAsyncProxy.java
Description: Binary data

Reply via email to