LOL Thomas.[?]

That was great example to determine async calls.

anyway what you are saying is right.

Its a bad design to have a method which returns something and then make
async call which

changes the state of some variable.

--
Aditya


On Wed, Jun 16, 2010 at 6:13 PM, Thomas Broyer <t.bro...@gmail.com> wrote:

>
>
> On Jun 16, 1:09 pm, Magnus <alpineblas...@googlemail.com> wrote:
> > Hi,
> >
> > because I cannot access a variable in the enclosing block from within
> > an AsyncCallback method I found the following workaround with a class
> > global variable, which I find very unpretty. How can one do this
> > better?
>
> What is it that you don't understand in "asynchronous"?
>
> I mean, your getUsr call will *always* end after the "return
> tmp_str_usr" statement. So, on the first call and until the server
> responds and you AsyncCallback is called, you'll get the empty string
> (initial value of the field); then AsyncCallback will change its
> value, and on all subsequent calls until the server responds to the
> new requests (and AsyncCallback will be called again) you'll get that
> value.
>
> When you ask your wife to get you some beer, the beer won't be there
> until your wife come back from the kitchen; and while she's gone, the
> football match isn't paused and life continues.
>
> --
> 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-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com>
> .
> 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 google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

<<360.gif>>

Reply via email to