Progress Emulation with GAE

Hello!

In my project i am implementing some tracking system of the user task completion progress. Thus I want some progress bars to be displayed in the table and corresponding objects should periodically update their progress values. I am using Google App Engine, which unfortunately does not fully support multithreading.
All those demo examples, that update progress bars via Threads seem not to work in such a case. I actually don’t see an obvious way to handle simple progress bar with GAE! That’s strange for me and I am pretty sure I am missing something useful.
The only workaround I figured out was to use either cron service or task/queue API of GAE. Basically, I want one of those to update all the active tasks in DB and somehow notify the view that it should sync with the database.
First of all, I would be really grateful if somebody experienced told me if I am at least in the right direction and there is no better way to periodic/background operations in my case.
The second question is how to notify the Vaadin Application gracefully about some changes made to data. The implementation of GAE cron jobs and Task/Queues implies the existence of some servlets for their code. Obviously, I have to send some requests/messages/notifications directly to the application out of those servlets.
But how?
As I am using Vaadin and GAE for just couple of months I might just not be familiar with the standard approaches, so any tips/advice/solutions would be really appreciated.

Thanks, Alex.

To update the state to the browser you could use eg. the
Refresher add-on
, which works with GAE. You need to handle the state visualization yourself, though. The general idea goes like this:

  1. Start a task queue job to do the background process, and update your UI to show that the process has started. Also start the Refresher polling.
  2. The background process runs, and updates the progress state (in the datastore, or eg. memcache)
  3. The Refresher listener reads the progress state and updates the UI accordingly.

Hi, Henry!

Thanks for your response! Appreciate it very much!
Now I at least now I got everything more or less right. Yeah, I also thought of involving Refresher add-on in this process. I will try to get it done today hopefully. My problem is that I have forgotten that GAE supports operations with the local thread! So I cannot spawn a new thread, but I can easily suspend the current one. So I have two additional servlets - one, that works in the background and after a timeout puts a task into a queue, and the worker servlet, that updates the object states. The refresher does his job also, so all that should and will work, as it does already with the test operations. The only bottleneck that remains I suppose is that I use JDO as an ORM in my app, so as I see it I will have to reload the container on each refresh… How nice it would be if I had an opportunity to update my BeanItem container out of that task execution servlet, but I believe I might encounter some serious troubles with synchronization…

Thanks again, Alex.

That’s true, but generally you want to update the container as late as possible, ie. when the UI wants it. Since you probably want to do that anyway at that point, the background task should not worry about that.

Or you could try implementing channel API from GAE and and push the values to vaadin through native javascript. But i did this only with plain GWT, not Vaadin.
Or make your own widget, tah would wrap this inside.