The Async interface is necessary because one does not want to use sync 
(blocking) rpc calls back to the server. When using blocking calls the  
entire browser freezes which is especially bad give responses arenot  
instantwous.

Hth

On 03/08/2009, at 1:10 AM, jd <[email protected]> wrote:

>
> Hi,
>
> I am just getting started on GWT and one of the things that strikes me
> is the amount of error prone black magic involved in creating an Async
> interface.  Sure tools can help you keep it in sync with your Service
> interface but something seems wrong with it.
>
> This may be naive but I was wondering if something like the new
> GWT.runAsync might be useful here? You could completely remove the
> need for the Async interface with code like this:
>
> GWT.runAsync(new Runnable()
> {
>    public void run()
>    {
>        try
>        {
>            StockPrice[] prices = stockPriceSvc.getPrices
> (stocks.toArray(new String[0]));
>            usePrices(prices);
>        }
>        catch (RemoteException re)
>        {
>            Window.alert("oops");
>        }
> });
>
> The stockPriceSvc would implement StockPriceService rather than
> StockPriceServiceAsync.  You also would not need the onFailure and
> onSuccess
>
> I imagine I am overlooking something!
>
> >

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to