For what it's worth, I was investigating adding a keyword for delayed responses with PSGI. Haven't really got done with it yet though. Perhaps tomorrow, if I go to the yearly Linux meeting in Israel, I might work on it there. 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.)
-- David Precious ("bigpresh") http://www.preshweb.co.uk/
"Programming is like sex. One mistake and you have to support it for the rest of your life". (Michael Sinz) _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users