Long running tasks - updating components

Hi!

I was playing a little bit with long running tasks: Create a (parallel) thread from the main app, and give the thread the Application to control its components…

Findings:

  1. I have som issues on updating components, when there have been some seconds of no updates. Periods of inactivity (no updates) result in not updating components later on. Any ideas/experiences?

  2. Having a ProgressIndicator updated frequently resolves 1)

  3. Is that the recommended approach for handling long running tasks updating Vaadin GUI? Creating a indenpendent thread that can access the whole Application to update its components?

  4. One challenge is to detect when a long running process has finished. I would like to set up a callback/handler for that, but dunno how… With that I could avoid having the Application to be a parameter for my long running thread.

TIA

Seems like this is how I described it:

http://vaadin.com/forum/-/message_boards/message/231271

Vaadin team: ?

No patch/fix? Again, the “book” is nice, but could be improved with a FAQ…

The linked post describes it: when programming for the web, there is no way for the server to make a connection to the browser and tell when something has changed. You need to use either polling or a push solution. The WebSockets based
DontPush add-on
is an alternative, it just lets a modern browser do the same things as the other add-ons do explicitly.

In the future, a push solution will probably be integrated in Vaadin core.

I would say this is one of the easiest topics to find information on: There are dozens of forum posts about this, and the linked post is one of only two sticky posts on the forum. There are several articles about this also elsewhere on the web, and background threads are mentioned in the book in the
chapter on ProgressIndicator
- a little hard to find in the book, I admit, but the book is about Vaadin core and not add-ons.

If you are a Pro Account subscriber, there are also
several articles about related issues and solutions
in the knowledge base, but the raw information is there in numerous forum posts as well.

I agree, the ProgressIndicator chapter is pretty good in the “book”.

The point is, the “book” lacks information concerning long running background tasks when not using ProgressIndicator.

Your reply implies that Vaadin is aware of this. Vaadin looks to be extreeeeemly intuitive, which implies that when I update an UI component, this update will actually update the UI.

Any prio/schedule on when Vaadin will include that push solution?
Is that solution what will make it possible to update UI components from long running tasks, without ProgressIndication / Add-ons?

TIA

It is planned for Vaadin 7, and will enable the server to tell clients when updates are available (via a connection that is first opened by the client).

Note, though, that polling and push each have their strong and weak sides, so in some situations it might still make sense to use polling, and in many cases you would want to limit the number of open connections by not activating push.