You cannot return something from an async call like that.  The work
will be done asynchronously, and the main program has presumably gone
on its merry way while the async things are being done.

If some object needs that result, a simple solution would be to pass
the object into the async method, and call a method on it with the
result when its ready.

-Ben

On Feb 21, 1:08 pm, Deepak Singh <[email protected]> wrote:
> Hi,
>
> How to set code splitting for entire body of methods with return type other
> than void as void onSuccess() will not allow to return anything?
>
> public Object myMethod() {
>
> //
> Object object = new Object();
> // method body
>
> return object;
>
> }
>
> After we code split point as,
>
> public Object myMethod() {
>
> GWT.runAsync(new RunAsyncCallback() {
> @Override
> public void onSuccess() {
> //
> Object object = new Object();
> // method body
>
> return object;
>
> }
>
> @Override
> public void onFailure(Throwable reason) {
>  }
>
> });
> }
>
> This will give error as onSuccess has void return type.
>
> Regards
> Deepak

-- 
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