Tomas Doran escribió:
Have a look at:
http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/Streaming/lib/Streaming.pm for a demo solution.

Thanks for the link, I was investigating on "streaming" results too, but
due to an old Catalyst (Debian Etch packages 5.7006), Response does not
support passing an FD to the body method!

So the alternative for people that use Debian Etch packaged Catalyst is to:

my $buffer;
my $bytes = 4096; #Arbitrary 4KB value for chunks. tune on your own.
open my $fh, "what you want to stream" || die "Can't open $!";
binmode $fh;

STREAM:
while ( read( $fh, my $buffer, $bytes ) ) {
    last STREAM unless $c->write( $buffer );
}
close $fh;

--
Jose Luis Martinez
[EMAIL PROTECTED]


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to