in reply to Re: Write a Filehandle w/Dancer2
in thread Write a Filehandle w/Dancer2

Tried the below off of the Dancer2 docs, but it returns 'foo':

return send_file( \'foo', streaming => 1, content_type => $mime_type, callbacks => { override => sub { my ($respond, $response) = @_; my $writer = $respond->([ 200, {} ]); my $buf = ''; while( read( $in_fh, $buf, VID_READ_LENGTH ) ) { $writer->write( $buf ); } } }, );

Running in the debugger shows that the callback never gets called.


"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Replies are listed 'Best First'.
Re^3: Write a Filehandle w/Dancer2
by Anonymous Monk on Aug 14, 2014 at 01:06 UTC

    ... Running in the debugger shows that the callback never gets called.

    Well :) time to UTSL good buddy