My suggestion would be to just run your own http event based sever in perl.
Example this would wait for request to http://localhost/doBigThing, then it sends back text message, then it start doing the big fancy database stuff, before going back to waiting again:
use AnyEvent; use AnyEvent::HTTPD; my $httpd = AnyEvent::HTTPD->new (port => 9090); my $cv = AnyEvent->condvar; $httpd->reg_cb ( '/doBigThing' => sub { my ($httpd, $req) = @_; $req->respond ({ content => ['text/html',"OK starting big datab +ase thingy now... I will be busy for several minutes.... " ]}); $cv->send; } ); while (1) { $cv->recv; print "Doing big fancy database stuff for a long time here..."; $cv = AnyEvent->condvar; }
In reply to Re: Can I have a Perl script, initiated from a browser, fork itself, and not wait for the child to end?
by sectokia
in thread Can I have a Perl script, initiated from a browser, fork itself, and not wait for the child to end?
by bartender1382
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |