[Zope3-dev] small proposal: a monitor api on live requests

Tarek Ziadé tziade at nuxeo.com
Sat Jan 21 20:59:23 EST 2006


Use case
--------

I would like to be able to construct smart forms with AJAX, that asynchronously display
a progress bar about uploaded datas. This is a quite interesting feature for forms that have files.
(the 'hey i am not dead' effect)

This feature has nothing to do with Z3 core of course, but there's a small problem to implement it.

Problem
-------

Javascript side is quite simple to realize to create those kind of forms, but it needs
to be able to monitor the state of a given request in another thread.

The server should be able to tell the amount of data it has already received for a given
request, etc..


Solution
--------

Add somewhere a table that keeps infos about all live requests, like:

- the current state: receiving | processing
- additional infos:
    receiving -> amount to receive / amount received
    processing -> what's beeing done (_last_obj_traversed, etc..)

and a few apis to get these infos

this could be hooked in the publisher's request classes in `processInputs()`, where we get the stream from twisted IIRC

Risks
-----

Could slow down the publisher 


Extension
---------

They are other use cases for such monitoring apis, when asychronous calls are involved (like zasync) 
Also I wouldn't mind having a 'cancel' button on my form, but this is another chapter :)

Any thoughts on this ?

Tarek 

-- 
Tarek Ziadé | Nuxeo R&D (Paris, France)
CPS Plateform : http://www.cps-project.org
mail: tziade at nuxeo.com | tel: +33 (0) 6 30 37 02 63
You need Zope 3 - http://www.z3lab.org/



More information about the Zope3-dev mailing list