in reply to Re^2: GET a file without waiting for the result?
in thread GET a file without waiting for the result?
It's curious that you don't want any error checking (in which case you could use Watch Long Processes Through CGI).
I can see two approaches.
Spawn a task to do the work.
use POSIX qw( setsid ); print "Content-Type: text/plain\n"; print "\n"; print "1"; my $pid = fork(); exit(0) if !defined($pid) || $pid; open STDIN, '</dev/null' or die; open STDOUT, '>/dev/null' or die; open STDERR, '>&STDOUT' or die; setsid(); ... handle request ...
Assign the work to an existing task or to a cron job.
... queue request in a file or database ... print "Content-Type: text/plain\n"; print "\n"; print "1";
|
|---|