[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mason
Subject:    Re: [Mason] finalizing browser connection but still working in background
From:       Chris Dawson <cdawson () webiphany ! com>
Date:       2003-10-23 3:28:18
[Download RAW message or body]

Sorry to bother everyone.  The answer to my question is "check the 
error_log."  My code sent to the register_cleanup function was crashing 
and this meant my function was dying at the top.  This was in the error_log.

Thanks,
Chris

Vegard Vesterheim wrote:

>On Wed, 22 Oct 2003 03:09:40 -0700 Chris Dawson <cdawson@webiphany.com> wrote:
>
>  
>
>>Hi there.
>>
>>I want to have a page which has code that generates a fully valid HTML
>>page, returns that page, and then continues to do a small amount of
>>processing in the background before the request is completed.  I have
>>been trying in vain to determine how to do this and my HTML::Mason
>>vocabulary is not adequate for searching on the site. Here is some
>>pseudo-code
>>
>>
>><html>
>><body>
>>% # perl code
>>% $var = 1;
>><% $var %>
>></body>
>></html>
>>
>><%finalize>
>># Mess with something briefly.
>><%/finalize>
>>
>>I know there is no finalize block, but this is basically what I want
>>to do.  There will be absolutely no output from the finalize block,
>>since of course the request has closed by this point.
>>
>>
>>I looked into the abort method and this seems like it aborts the
>>current request, rather than finishing it off first.  I want to make
>>sure the HTML file is completely returned before I can do the things
>>in the finalize section.  I know how to do everything else, but I
>>cannot how to make the browser release the request and display the
>>page while I am still processing in the background.
>>
>>
>>    
>>
>
>You can use the Apache API function register_cleanup to do this. Like this:
>
>$r->register_cleanup (sub {printf STDERR "Cleaning up ..."; sleep 10; printf STDERR "OK\n"});
>
>  
>




-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic