[Catalyst] code after finalize: mod_perl,
testserver ok - fastcgi not
Josef Chladek
josef.chladek at boerse-express.com
Sat Apr 7 10:00:19 GMT 2007
hello list,
we try to execute some long running code after finishing the request,
$c->response->content_type('text/html; charset=utf-8');
$c->res->body('blabla...');
$c->response->status(200);
$c->finalize;
$c->forward('very_long_running_code');
while this works perfectly when running the testserver or under
mod_perl, it won't work when used with apache and
FastCgiExternalServer /usr/local/www/catalyst/Xatalyst/script/
xatalyst_fastcgi.pl -flush -host 127.0.0.1:55900
the process returns the output to the browser AFTER the code has run
(or even worse, after 30 secs we get a timeout, which we could change
by setting the -idle-timeout for fastcgi, but is not what we really
want).
we tried the Catalyst::Plugin::AfterFinalize (which was posted to
this list in october)
$c->response->content_type('text/html; charset=utf-8');
$c->res->body('der newsletter wird verschickt');
$c->response->status(200);
$c->after_finalize(sub{ very_long_running_code($self,$c)});
again, this works under testserver and mod_perl, but not with fastcgi
in apache.
any suggestions how to change the code, so we could use it with
FastCgiExternalServer?
thanks
josef
More information about the Catalyst
mailing list