durusmail: quixote-users: Displaying results of a processor intensive operation in increments possible under quixote?
Displaying results of a processor intensive operation in increments possible under quixote?
2004-11-18
2004-11-18
2004-11-19
2004-11-19
Displaying results of a processor intensive operation in increments possible under quixote?
Jonathan Taylor
2004-11-18
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.
reply