Hello,

Were are trying to run long a task (DB import) from a HTML::Mason page
and are trying to send an immediate response to the user while the task
is running. Here is our pseudo-code:

<%init>
sub long_running_task {
        # lottsa long, boring stuff
}
$r->puch_handlers(PerlCleanupHandler=>\&long_running_task($myarg));
</%init>

The rest of the page sends back HTML. The problem is that it _not_ sent
back until the long_running_task function has completed.

I thought that when registering a code ref in that way the sub{} would
not be called until later during the PerlCleanupHandler phase.

Am I missing something, is there a better way to do it?

Thanks in advance for your insight,

-- 
 HIPPOLYTE: Quelques crimes toujours précèdent les grands crimes.
            Quiconque a pu franchir les bornes légitimes
            Peut violer enfin les droits les plus sacrés ;
                                          (Phèdre, J-B Racine, acte 4, scène 2)

Reply via email to