[IPOL discuss] Time out

Nicolas Limare nicolas.limare at cmla.ens-cachan.fr
Tue Feb 8 10:34:38 CET 2011


> I think it'd be nice if the final web users could see a percentage of the
> progression of the computations of the algorithm.

Yes, this would improve the user experience.

> Most of them consist on repeated operations inside one or more loops and
> the program can overwrite a text file with that percentage. It's very
> simple, and of course it doesn't have to be mandatory for all the
> publications.
> 
> The page could poll this value every 10 seconds for example and update a
> progress bar.

This design implies that the code is specifically written for the
demo, because such feature (updating a file) is useless out of the web
demo context. I think the main use case for programs provided in IPOL
should be the general command line, and we should design the demos to
adapt to the programs.

A possibility is to have the program continuously write some progress
information to its standard output, then this standard output can be
captured into a file, and the file periodically read and displayed in
the web page.

> It is very easy to implement and I think that this is needed to make the
> user feel that the algorithm is really being computed and when is it going
> to finish.

I think it is not straightforward to implement.

Currently, we launch the algorithm processing with `p = run_proc(...)`
and we wait for its completed execution with `wait_proc(p)`. If we
want to display something before the end of the algorithm execution,
we must return the page content after `run_proc()` and before
`wait_proc()`. This can be a page with a 10s refresh time.

When the page refresh is called, it can include the key id to read and
display the current standard output content, or a progress bar. But we
can no more use `wait_proc(p)`, because the process object has been
lost between the two pages. Thus need to find a way to store the
process descriptor object on the server and retrieve it if we want to
be able to wait for its completion and controle its timeout.

Another solution is to keep the current design and include in the
"wait" page some Ajax code to request and refresh the progress
information with Javascript.

Demo contributions with this kind of improvements are of course
welcome.

-- 
Nicolas LIMARE
http://nicolas.limare.net/                         pgp:0xFA423F4F
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://tools.ipol.im/mailman/archive/discuss/attachments/20110208/0c757d57/attachment-0001.pgp>


More information about the discuss mailing list