<div dir="ltr">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.<div><br></div><div>In case it is helpful, there is some more information on PSGI and streaming in the Catalyst advent calendar here:<div><br></div><div><a href="http://www.catalystframework.org/calendar/2013/10">http://www.catalystframework.org/calendar/2013/10</a> (four part series)<br></div><div><br></div><div>and the PSGI FAQ has some information on streaming:</div><div><br></div><div><a href="https://metacpan.org/pod/PSGI::FAQ#What-if-I-want-to-stream-content-or-do-a-long-poll-Comet">https://metacpan.org/pod/PSGI::FAQ#What-if-I-want-to-stream-content-or-do-a-long-poll-Comet</a><br></div><div><br></div><div>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.</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 13 October 2015 at 06:51, Joerg Fallmann <span dir="ltr"><<a href="mailto:fall@tbi.univie.ac.at" target="_blank">fall@tbi.univie.ac.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>
<div>
<p>Hi Everyone,</p>
<p>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,<br>
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.<br>
Example code here:<br>
</p>
<pre><code>get '/test/:*?' => sub {
my $id = params->{'id'};
my $blub = params->{'blub'};
delayed {
my $tt = Template->new(
{INCLUDE_PATH => "$path",
WRAPPER => '<a href="http://layout.tt" target="_blank">layout.tt</a>',
RELATIVE => 1,
}) || die "Template error: $Template::ERROR\n";
$tt->process('<a href="http://view.tt" target="_blank">view.tt</a>', {
'id' => $id,
'bla' => $blub
};
content $tt;
### Process further
push my @more, "String";
my $tt2 = Template->new(
{INCLUDE_PATH => "$path",
WRAPPER => '<a href="http://layout.tt" target="_blank">layout.tt</a>',
RELATIVE => 1,
}) || die "Template error: $Template::ERROR\n";
$tt2->process('<a href="http://view.tt" target="_blank">view.tt</a>', {
'id' => $id,
'bla' => $blub,
'more' => \@more
};
content $tt2;
done;
};
};
</code></pre>
Is this possible or am I completely on the wrong track?<br>
Thanks,<br>
Joerg<br>
<br>
</div>
Phone: +43 1 4277 52732 </div>
</div>
<br>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br></blockquote></div><br></div>