[Catalyst] "Streamed" content delivery?!

Jose Luis Martinez jlmartinez-lists-catalyst at capside.com
Tue Aug 5 08:43:40 BST 2008


Heiko Jansen escribió:
> But no matter which one I choose the main question is this: 
> Can I send data to the client incremetally (or you could say: as a stream) with catalyst? 
> I want to send (using HTTP/1.0 without content-length header) the start of the html page when I receive the request; then send out a block for every databases result and finally (after the last db or a search timeout) a page footer. 
> I'm a novice regarding catalyst and have so far only seen code examples where all output generation is done as a whole at the end of the requests lifecycle and I'd be very happy if you could tell where to look for examples or documentation concerning my needs.

The Catalyst::Response object docs says:

$res->body(<$text|$fh|$iohandle_object)

     $c->response->body('Catalyst rocks!');

Sets or returns the output (text or binary data). If you are returning a 
large body, you might want to use a IO::Handle type of object (Something 
that implements the read method in the same fashion), or a filehandle 
GLOB. Catalyst will write it piece by piece into the response.

Hope that helps

Jose Luis Martinez
jlmartinez at capside.com



More information about the Catalyst mailing list