the.wizard
the.wizard

Reputation: 1109

Update / Refresh View while GWT RPC progressing

I have a requirement to update my view while my GWT application doing GWT RPC. Here is my case, I have to send some data to my GWT servlet, then in my servlet, I feed it to a server side component (optaplanner solver), and it will run for some time. This component have a event handler for every un-final result released. Now what I want is to get those un-final result and populate it in my view until the final result was released from the optaplanner solver component. These requirement very similar to upload file and track the progress. Please kindly give me your suggestions how to achieve this. Thanks & Regards.

Upvotes: 1

Views: 309

Answers (1)

Andrei Volgin
Andrei Volgin

Reputation: 41089

You have two options:

  1. Start a timer in your GWT code which will periodically ask the server "Do you have something for me?" The server may respond with null or with the intermediate results that you can show to your user.

  2. Use a server-push technology.

The timer option is much simpler - it requires only a few lines of code and no external libraries. It is also a standard solution when the timing of an event is not critical (unlike games and some other applications).

Upvotes: 2

Related Questions