[dancer-users] Dancer and forking

Andrew Beverley andy at andybev.com
Tue Jul 7 22:58:57 BST 2015


Dear all,

Is there anything that I should be aware of if using fork() in a dancer
application?

I have some cache update code which can take a while to run, so I'd rather do it
in the background. I've therefore done something like this:

    post '/data' => sub {
        my $template = ...;
        fork and return $template;
        update_cache;
        exit;
    }

The actual code is in a module, but you get the idea.

Thanks,

Andy



More information about the dancer-users mailing list