the fork and return appears to work for me.
I tried:
#!/usr/bin/perl
use Dancer;
get '/' => sub {
fork and return "Content!\n";
sleep 10; # do your actual work here
warn "Child process done\n";
exit;
};
dance;
Running that via the standalone server, or via plackup/Starman, works as expected - the "Content!\n" is returned to the user's browser immediately, and the request is over; the forked process hangs around for ten seconds sleeping, then issues the warning (visible on the terminal) then exits.