At 2:06 PM +0000 4/2/01, [EMAIL PROTECTED] wrote:
>I need to run some stored procedures that take upwards of a minute to generate
>result sets. Ok, thats grand but I dont want the browser to sit there and
>twiddle.
>
>I'd like to display an animated gif. Simple. Right? I hope.
>
>I'm looking into chained handlers in my mod_perl code, but I'm not 
>sure if this
>is what I need.
>
>0) Request page and report.
>1) Push 'Waiting...' animated gif
>2) Process report, Perl waits for result set
>3) Perl pushes the report html to the browser as if it opened in a target =
>_blank window. IE: That same window...
>Stumped (or rather -> RTFMing),
>
>Any ideas?  I cant, for the life of me, figure out how this would work with
>http redirects, and thought there might be something with mod_perl that would
>help this.  Fork() maybe.  I'm trying a few ideas.




It's probably out of date, but the CGI::Push module does exactly what you want.

The doc isn't real clear, but I've used this once to do exactly what 
you're doing.  Unfortunatly, I can no longer find the code I wrote...

Basically, CGI::Push sends a multipart mime message to the browser. 
The first part of that is an HTML document, which the browser renders 
immediatly.  The second part is the confirmation HTML, which the 
browser also renders in place of the original document.

The basic syntax is

use CGI::Push qw/:standard/;

do_push(-next_page => \&header);
sleep 30;
do_push(-next_page => \&body);
do_page(-next_page => sub { return undef; });

&header and &body both return a FULL html document, including the 
headers.  Returning undef terminates the connection with the browser.

Good luck,

Rob

--
As soon as you make something foolproof, someone will create a better fool.

Reply via email to