Do you use DeferredCommand? This way, onSuccess can execute before the
DeferredCommand is executed.

Javascript is single-threaded: if you need locking for different
asynchronous tasks, you can do it using a global variable.

Viliam

On 13. Jan, 05:22 h., Isaac Truett <[email protected]> wrote:
> Hi Mike,
>
> Are you sure the responses are being handled concurrently? JS is
> indeed single threaded, so you should be seeing those responses
> handled sequentially, although the order in which the requests will
> return is not guaranteed.
>
> Based on your description, I would suggest disabling the button after
> sending the request. In both onSuccess() and onFailure() you can
> re-enable the button.
>
> Hope that helps.
>
> - Isaac
>
> On Tue, Jan 12, 2010 at 7:47 PM, Mike Noordermeer <[email protected]> wrote:
> > Hi,
>
> > I have a small problem with RPC requests and concurrency and would like to
> > know if what I'm seeing is correct and what's the best way to solve it.
>
> > Situation:
>
> > - Some page with some list and some refresh button/action
> > - User clicks refresh multiple times
> > - Multiple RPC requests go out
> > - onSuccess() gets called multiple times, concurrently, and list gets filled
> > with duplicate items from different requests
>
> > Is it correct that onSuccess() can run multiple times concurrently? What's
> > the best way to solve this? Afaik javascript doesn't have any locking
> > semantics (but I also thought it was single threaded, so...)
> > I could save the request and cancel the old one when a new request is
> > done...
>
> > Thanks in advance for any replies :-)
>
> > --
> > Mike Noordermeer
> > [email protected]
>
> > --
> > 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.
-- 
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.


Reply via email to