benstpierre
benstpierre

Reputation: 33571

A progress bar to monitor a long running task in GWT

I need to write a progress bar that monitors the progress of generating some very large PDF files. We know how to very accurately watch the progress of generating the PDF file on the server side but cannot figure out a good way to monitor the status from the browser.

A few suggestions..

  1. Create guid for the job when the servlet/gwt-rpc request happens to start the job, return the guid to the client. Every x seconds query another gwt-rpc method with that earlier returned guid. As progress happens on the slow running process we push the status to a session variable with a name of that guid. When we reach 100% download the file from a dynamically determined location and send the actual file to the browser via a normal servlet.
  2. Use ajax-push to have a long running http connection push the status instantaneously.

Does anybody have suggestions for how to design a robust progress bar?

Any suggestions for how to handle this? As far as the UI is concerned I will likely write my own widget as the gwt-incubator project's status bar is deprecated ( along with the whole project ).

Upvotes: 1

Views: 814

Answers (1)

Kathir
Kathir

Reputation: 6196

We have the similar scenario. We run multiple jobs on the server and during the execution we poll the server with the job id. When the job is done we update the GUI status to done. We used RequestFactory since we store the job status in the database. It works perfect.

Upvotes: 1

Related Questions