[Web-SIG] Emulating req.write() in WSGI

Ian Bicking ianb at colorstudy.com
Tue Jun 29 22:25:45 CEST 2010


On Mon, Jun 28, 2010 at 2:50 PM, Gustavo Narea <me at gustavonarea.net> wrote:

> http://pythonpaste.org/waitforit/
>

It will address this problem, but not with mod_wsgi as it relies on threads
to handle the queuing (the request is deferred to a thread, and in-memory
data structures are used to get the result).

One of the solutions proposed ("Take them immediately to a secondary page,
then submit the actual job automatically on that second page.") actually
seems most reasonable to me, as it allows you to give any UI you want (where
writing out a response incrementally is fairly constrained), and can be
generalized fairly easily.  And if you use a little persistence (something
WaitForIt doesn't have the benefit of using) you could fire off
XMLHttpRequests to get an update.  Hmm... WaitForIt would almost be better
simply doing this, except it tries to be clever by avoiding interstitial
pages if the response isn't slow.

And then there's really cheap tricks, like:

<button type="submit" onclick="this.innerHTML = 'submitting...';
this.disabled = true">Submit</button>

-- 
Ian Bicking  |  http://blog.ianbicking.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/web-sig/attachments/20100629/d1e0e06b/attachment.html>


More information about the Web-SIG mailing list