[Dancer-users] Output before after

Maurice Mengel mauricemengel at gmail.com
Wed Feb 2 15:22:48 CET 2011


Hi David,

Sorry for not being more intelligible. Apparently, I never know what
is too little and what is too much.

> ...but the content
> to be sent back to the user is returned at the end of the request

You say at the end of the request, the question is what is "at the end
of the request". For a moment, I thought that AFTER allows me to
process something after the request. But this seems not to be the
case. AFTER takes place after the other routes are processed, but it
still part of the request. Output is "delayed" until AFTER is done.

I extract data from db and turn it into xml to return it via http. xml
can get pretty big, so I split it into chunks and return only a chunk
at a time.

Currently, I return first chunk on request and write the others on
disk (to be returned on new requests). I have to wait until all chunks
are written to disk until the first chunk is sent out. It can take
mintues until done. Behind a reverse cache it could work speedwise.

This was my question. While writing you, I can think of a possible
solution: finish the request with the first chunk,  save the statement
handle to session and continue processing when the next chunk is
requested.

thanks
maurice






On Wed, Feb 2, 2011 at 6:32 AM, David Precious <davidp at preshweb.co.uk> wrote:
> On Tue, 2011-02-01 at 17:55 -0500, Maurice Mengel wrote:
> Hey perl dancers,
>>
>> is there a way that I can output stuff before I enter in the after
>> route? That way I could emulate enough streaming.
>
> Not sure I entirely understand what you're trying to do, but the content
> to be sent back to the user is returned at the end of the request as I
> understand it.
>
> Can you be a little clearer on what you're trying to do?
>
>
> --
> David Precious <davidp at preshweb.co.uk> ("bigpresh")
> http://www.preshweb.co.uk/
>
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>


More information about the Dancer-users mailing list