On 10/14/2015 6:26 AM, Joerg Fallmann wrote:
Dear John,

what I would like to do is to stay in one route,
display whatever information I already have,
so that the user can start reading output,
while I continue processing until I have everything I need
and update what the user can see with the final information.
That is what I get when I pull the info after I've loaded the first chunk.

So similar to what delayed does when I use strings as content,
with the difference that I would like to use templates filled with
the initial content and update that templates content once processing
is done.

So far I have a myhost/welcomepage where the user can select some stuff
and is then redirected to myhost/results. From the user input I can
quickly create some content, but some other content takes some time,
and I would like to show what I have fast at myhost/results and update
myhost/results when the rest is done without redirecting to yet another route,
instead of computing everything and then /push/ it to the user after minutes.
That sounds very much like what I do. I show the initial page, let the user select the desired info and then I go to the appropriate route. I display initial info in a header and footer, and then a js onLoad function grabs the remaining data from another route (similar to your results route). Sometimes that's a lot of JSON data and can take some time do download. I use datatables for the actual load and display for some of the routes.

@Amelia, I was playing around with delayed, and for me it works as expected
when I only want to return simple stuff like in the manual, but when I try to
use templates as content nothing happens until the very end of the route,
so just the final output is created and no in-between output.

Hope what I want to do is possible with Dancer2

--joerg

--
John J. McDermott, CPLP
Learning and Performance Consultant
jjm at jkintl.com 575/737-8556
Check out my security blog posts
Add an A for the Arts To STEM and get STEAM and a strong engine to move forward.