[Zope] streaming data through zope from an external method.

Paul Everitt Paul@digicool.com
Wed, 10 Mar 1999 06:30:28 -0500


Anthony wrote:
> I've got an external method that is generating a (possibly 
> quite large) 
> audio file and sending it back. Right now, I'm generating 
> this in memory
> in a big string, then returning it to zope. I'd _like_ to be 
> able to just
> have the external method send the data straight through 
> (maybe in chunks)
> without having to read it all into memory. Is this possible with zope
> at all?

I think the first problem will be finding a publisher that streams.
PCGI buffers all I/O, perhaps FastCGI doesn't.  Even if you didn't,
sending it through Zope in chunks would avoid getting Zope's memory
footprint up there.

One way would be to have the ExternalMethod return a sequence, then do
something like:

<!--#in myExtMeth-->
  <!--#var "RESPONSE.write(sequence_item)"-->
<!--#/in-->

Of course the above might be completely wrong, but you get the drift :^)

--Paul