[Catalyst] Proper way to perform cleanups on server shutdown?
Mark Zealey
mark at itsolve.co.uk
Wed Jul 11 19:03:58 GMT 2007
Perhaps I'm missing something, but what's the problem with doing something
like:
package MyApp;
$SIG{INT} = sub {
graceful_shutdown();
exit(1);
}
END { graceful_shutdown() }
sub graceful_shutdown {
# Code here...
}
Note that a $SIG{INT} will not exit if you override it, which is why you need
the exit. This means that you could make it restart on a SIG{INT} (or perhaps
better, $SIG{HUP})
Mark
More information about the Catalyst
mailing list