<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I'm trying to understand the issue here and what you want to do. Is
it correct that the issue is that you (Joerg and Amelia) want to <i>push</i>
data to the user in multiple chunks?<br>
<br>
I do something similar with a push then a pull. I display the page
with a template that has the header, some data and a footer. On load
the page requests a different route through Dancer2 which populates
the remaining data. In my case if the route is myhost/page, the page
template requests myhost/pagedata (with appropriate parameters).<br>
<br>
--john<br>
<br>
<div class="moz-cite-prefix">On 10/13/2015 1:29 PM, Amelia Ireland
wrote:<br>
</div>
<blockquote
cite="mid:CAEWSiHggJzwPw5=HzFiK1M=XM-mbMOA54jHqJK6uutYzi4O+bQ@mail.gmail.com"
type="cite">
<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 moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true" href="http://layout.tt" target="_blank">layout.tt</a>',
RELATIVE => 1,
}) || die "Template error: $Template::ERROR\n";
$tt->process('<a moz-do-not-send="true" 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 moz-do-not-send="true" href="http://layout.tt" target="_blank">layout.tt</a>',
RELATIVE => 1,
}) || die "Template error: $Template::ERROR\n";
$tt2->process('<a moz-do-not-send="true" 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 moz-do-not-send="true"
href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a moz-do-not-send="true"
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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
dancer-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a>
<a class="moz-txt-link-freetext" href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a>
</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
John J. McDermott, CPLP<br>
Learning and Performance Consultant<br>
jjm at jkintl.com 575/737-8556<br>
Check out my <a href="http://cybersecurity.learningtree.com">
security blog posts</a><br>
Add an A for the Arts To STEM and get STEAM and a strong engine to
move forward. </div>
</body>
</html>