Monday, February 28, 2011

Re: Method Reference Delegate or so

Here's one solution: For each onSuccess method call back set some flag value to indicate it has completed.

Issue all thre rp calls.

Set a timer that runs a check of all three values set by their respective onSuccess methods. If they all indicate that their respective rp calls have completed do the processing needed at this point which relies on all 3 rp calls to have completed. Otherwise, restart the timer. Keep the lapse time quick so as not to block the ui.

Jeff
 

On Sat, Feb 26, 2011 at 3:43 PM, andi <andi.balke@googlemail.com> wrote:
Hi all,

I'm looking for a solution how to transport a method reference. Usecase is to wrap some async method calls and only have one success handler after all are doen.

E.g. I want something like this (which would easily possible in JS):

Requestor req = new Requestor();
req.add(Foo.method, param, param);
req.add(Bar.method, param);
req.do(new SimpleMethodCallback<JSONValue>() {
    @Override
    public void onSuccess() {
    // ...
    }
});

Someone has a solution how to accomplish this?

Thanks in advance,
Andi

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Jeff Schwartz
http://jefftschwartz.appspot.com/
http://www.linkedin.com/in/jefftschwartz
follow me on twitter: @jefftschwartz

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment