According to
http://www.mems-
exchange.org/software/files/quixote/Quixote-2.0a1.tar.gz/CHANGES,
there is a 'buffered' flag on the HTTPResponse object, as of version 1.1, which
defaults to True. I haven't worked with it, so can't verify how/if it works,
but I'd start by looking there if you're using 1.1+. If you're not, I'd still
look at it just to see how it was done.
Of course, this doesn't fix the [potentially larger] issue that your server will
block, not serviceing any other requests until it's done with the current
request (unless you're doing CGI, or have many S/FCGI processes, or are using
threads, etc...) Maybe you're not concerned with that... It doesn't sound like
a typical many-user web app :)
Jason
Quoting Jonathan Taylor :
> Hi,
>
> I want to do something fairly computationally intensive with some DNA
> sequences inputted from a form. There are likely 60-80 dna sequences
> and each takes a second or two to process. I would like to print some
> results to the web page after each dna sequence is processed. Is this
> possible?
>
> I have been able to get this to work somewhat using the Stream class in
> http_response. Here is some code:
>
> from quixote.http_response import Stream
>
> def completed [html] ():
> """Sequence Added.
"""
>
> def process():
> for j in range(1,50):
> yield str(completed())
> time.sleep(1)
>
> def test(request):
> return Stream(process())
>
> The problem with this is that it seems to cache the output. In other
> words, the browser will wait for like 10 seconds and then all of a
> sudden I see 10 lines. If I make the Line
longer than it will
> return faster. Is there some way to turn off buffering here to make it
> send out data to the browser as soon as it is available?
>
> Thanks for any help.
>
> Sincerely,
> Jonathan Taylor.
>
>
> _______________________________________________
> Quixote-users mailing list
> Quixote-users@mems-exchange.org
> http://mail.mems-exchange.org/mailman/listinfo/quixote-users
>