I'd like to do the same thing. I haven't yet been able to identify at which point the streaming is failing (the browser? Apache proxy? Twiggy? Dancer?), and have been waiting to see if any of the Dancer2 team will explain things further.
In case it is helpful, there is some more information on PSGI and streaming in the Catalyst advent calendar here:
http://www.catalystframework.org/calendar/2013/10 (four part series)
and the PSGI FAQ has some information on streaming:
I haven't had a chance to do much research lately, but my next steps will be to find some other streaming PSGI apps to test (e.g. written with simple Plack, or some Catalyst or Mojolicious apps), to try to track down whether what we want to do is possible or whether the terminology is misleading.
On 13 October 2015 at 06:51, Joerg Fallmann <fall@tbi.univie.ac.at> wrote:
Phone: +43 1 4277 52732Hi Everyone,
What I'm looking for is a way to render a template with part of the results to the user to see while I continue processing and when I'm done I want to show the final template with all results. I'm currently using the new delayed method, which works fine for strings,
but if I want to render templates it does not provide content until the very end, so no in-between output is produced, as I would like to show.
Example code here:
Is this possible or am I completely on the wrong track?get '/test/:*?' => sub { my $id = params->{'id'}; my $blub = params->{'blub'}; delayed { my $tt = Template->new( {INCLUDE_PATH => "$path", WRAPPER => 'layout.tt', RELATIVE => 1, }) || die "Template error: $Template::ERROR\n"; $tt->process('view.tt', { 'id' => $id, 'bla' => $blub }; content $tt; ### Process further push my @more, "String"; my $tt2 = Template->new( {INCLUDE_PATH => "$path", WRAPPER => 'layout.tt', RELATIVE => 1, }) || die "Template error: $Template::ERROR\n"; $tt2->process('view.tt', { 'id' => $id, 'bla' => $blub, 'more' => \@more }; content $tt2; done; }; };
Thanks,
Joerg
_______________________________________________
dancer-users mailing list
dancer-users@dancer.pm
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users