On Thu, Aug 11, 2011 at 9:27 PM, David Precious
<davidp@preshweb.co.uk> wrote:
On Thursday 11 August 2011 18:17:47 David Precious wrote:
> Another possible alternative would be to fork a new process that will do
> the stuff in the background, whilst the original process continues
> onwards to send the response back to the client.
For the time being, at least, this is probably the easiest option.
Something like:
hook after => sub {
if (fork) {
# parent - do nothing
} else {
# Child - sleep for a while
sleep 50;
exit;
}
};
With a quick test, that works as expected. (The exit is required, so that the
child process doesn't then go on return control to Dancer.)