I just meant something like this.

void *pollForEvents() *{
  server.getEvents(new AsyncCallback() {
    public void onSuccess(Event[] result) {
      handleEvents(result);
      *pollForEvents();*
    }
    public void onFailure(Throwable caught) {
      // do something with the error...
      if (shouldRetry(caught))
        *pollForEvents();*
    }
  });
}

On Mon, Feb 8, 2010 at 4:22 AM, SergeZ <[email protected]> wrote:

> Can you give a simple example of how to make this "looped"
> asynccallback call ?
>
> On 8 фев, 11:39, Joe Cheng <[email protected]> wrote:
> > If you use a timer, your data will be delayed by up to the period of the
> > timer (e.g. if your timer fires every 5 seconds then there will be a
> delay
> > of up to 5 seconds to display your data).
> >
> > Rather than an infinite while or for loop, you can "loop" by having the
> RPC
> > call's AsyncCallback onSuccess and onFailure methods make the RPC call
> > again. On the server side, you can make the RPC call block until some
> data
> > is ready. (You don't want to block for too long, otherwise the RPC call
> will
> > time out--but not too short either, otherwise you will be creating
> > unnecessary network traffic).
> >
> >
> >
> > On Sun, Feb 7, 2010 at 12:46 PM, SergeZ <[email protected]> wrote:
> > > Thanks to your all for answers on my question! I'll try to call the
> > > run() method ( how can I\ forgot to call it))  ). But I thinking that
> > > it will not helps me...
> >
> > > Actually, I have the one concrete task - create some similarity to
> > > monitoring system. My software must receive data from DataBase and
> > > represent it without any delays. Server's part of App based on summary
> > > of Sockets, Rmi technologies. And Client part of app - of course GWT
> > > GUI. Both of them connects through RPC AsyncCall. (it's just a
> > > standart GWT's scheme applications )  So, the real question is about
> > > possibility to create these app.. As I rightly understood, the only
> > > way I can use to get data from Server Side - is to use RPC call to
> > > server's method  and I can NOT do this in an infinite loop because It
> > > will interrupt my app's logic. And also I can NOT use for this
> > > purposes threads - due to signle-threadness of JavaSript. Am I right
> > > about that I can just simulate a real-time data receiving through
> > > using GWT's timer and each time when a timer will expired I'll have to
> > > make a RPC call to Server Side to getting the data ?
> >
> > > --
> > > 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]<google-web-toolkit%[email protected]>
> <google-web-toolkit%2bunsubs­[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]<google-web-toolkit%[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