[mod_python] req.write() in use by PSP

Graham Dumpleton graham.dumpleton at gmail.com
Sun Jul 29 18:02:10 EDT 2007


On 30/07/07, rhn <rhn at o2.pl> wrote:
> Hi
>
> I've run into a problem trying to embed long lasting functions in my .psp files.
> As far as I know, the req.write() method sends data directly to the client, with no buffering.
>
> I have the following code:
>
>
>
> <html>
> <body>
> <%
> import time
> %>
> for i in range(10):
>     time.sleep(5)
> %>
> <p>Hello, my name is Joe</p>
> <%
>
> %>
> </body>
> </html>
>
>
> I expect it to write the above paragraph in 5-second intervals, but it seems that mod_python waits until the last command executes, then sends the whole content.
>
> Is there any way to reconfigure the psp handler to disable buffering or do I have to rewrite it?

Have you tried inserting a call to:

  req.flush()

Graham


More information about the Mod_python mailing list