Single Thread + Progress Indicator

Hi guys,

I am developing on GAE, as most of you know it means:
1- I cannot execute a request that takes more than 30 secs to serve
2- I cannot create a new thread

I am trying to perform an operation that takes a fair amount of time to complete, say importing some records in the database.
I would be nice to update the UI with a progress bar while the operation is still running.

What do you think? Is that possible?

I could think of developing a custom
echo
component. Using this component I could run a part of process, update this component, and then client side of this echo component automatically calls the Java code back. This way different chunks of the whole task will be seen by GAE as fresh requests making the application in a good shape, not exceeding the limits.

Is that doable? Is it a better way?

Thanks,
Houman

It should be possible to with
http://code.google.com/appengine/docs/java/taskqueue/overview.html
. You could maybe update the progress bar state in
HttpServletRequestListener
.

Have not tried this though, so if you try it keep us posted :slight_smile:

Thanks, I’ll give it a try.
That was the last thing I wanted to do, not sure how responsive it would be for the user.

I actually didn’t try Google’s task queue. Instead I developed a custom Echo component that can simulate a backend to front end round trip.
Using this component I managed to break down my big task and do it chunk by chunk so that GAE doesn’t complain.

I have put up the complete source code here:
http://code.google.com/p/tinywebgears-samples/source/browse/#svn%2Ftrunk%2Fechosample

It can be checked out using this command:
svn checkout http://tinywebgears-samples.googlecode.com/svn/trunk/echosample/ echosample-read-only

More information about this can be found
here
.

I hope that we will see the Echo also as an add-on in the Directory :wink: