[Zope-dev] Streaming Response

Johan Carlsson [EasyPublisher] johanc@easypublisher.com
Fri, 11 Apr 2003 10:31:15 +0000


At 11:36 2003-04-10 -0700, Brett Carter said:
>
> > My problem now is that I need something that works with IE. There's funny
> > things going on with my hairs and toes when I hear the word "ActiveX
> > plugin", so I'm still hoping for alternatives.
>
>This doesn't work with IE5 or IE6 on the PC.  It does work with IE5 on mac
>though strangely enough.  One solution is not to use IE :)

What doesn't work in IE? Am I missing something?

I tried the Python Script bellow with the same behavior in both
IE (IE6) and Mozilla (each paragraph was written in intervals I don't
now how to do a sleep in Python Scripts so I use a for loop
that I trimmed to produce measurable intervals on my server
(a rather slow machine)).

Best Regards,
Johan Carlsson


RESPONSE =  container.REQUEST.RESPONSE
base =["<p>%s: Small 1</p>","<p>%s: Small 2</p>","<p>%s: Small 3</p>"]
start="<html><head><title>It's comming: %s</title></head><body>"
stop="<h1>%s</h1></body></html>"

RESPONSE.setHeader('Content-Type', 'text/html')
RESPONSE.write(start%"Starting")
for i in range(800000): j=str(i)
RESPONSE.write(base[0]%str(0))
for k in range(800000): j=str(k)
RESPONSE.write(base[1]%str(1))
for t in range(800000): j=str(t)
RESPONSE.write(base[2]%str(2))
for r in range(800000): j=str(r)
RESPONSE.write(stop%'stop')



-- 
Easy Publisher Developers Team
Johan Carlsson
johanc@easypublisher.com

Mail:
Birkagatan 9
SE-113 36  Stockholm
Sweden

Phone +46-(0)8-31 24 94
Fax +46-(0)8-673 04 44
Mobil +46-(0)70-558 25 24
http://www.easypublisher.com