On 17 juin, 12:06, ArunDhaJ <[email protected]> wrote:
> Hi All,
> I'm sending multiple requests to server in a while loop, and I want
> next line of the while loop to be executed only after completing all
> requests. How can I make to wait till completion.
Just don't!
(and embrace asynchrony instead)
If you can, refactor your code so that you send only a single big
request, or at least batch some of them.
Otherwise, refactor your code so that the async "on response" (exact
name depends on whether you use GWT-RPC or RequestBuilder) checks
whether all sent requests have completed (you can increment a counter
on each received response and compare it to the total number of
requests, i.e. the number of iterations of your while loop) and only
then do what you'd have liked to put as "the next line of the while
loop".
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---