Forking and BG processes in PHP
| From: | Massimiliano Bariola | Date: | Tue, 06 Nov 2001 10:15:07 +0000 |
| Subject: | Forking and BG processes in PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-73565@lists.php.net to get a copy of this message | ||
Hi everybody,
I wasn't able to find a good answer in the archives, so I thought I
would ask here.
This is the scenario: An user can request a time-expensive DB
processing via a PHP page. I'd like to arrange for having a
confirmation page telling the user that the request is being
processed, and then redirecting him/doing whatever else/etc.
Meanwhile, there should be a process actually doing the DB work.
When it's finished, it should send a mail to the requester including
an URL for the download of the results of the operation.
Problem is, is there a way to make PHP start a background process
which is independent from the spawning page time-line?
the closest I've seen to this is the use of
register/unregister_tick_function but it isn't clear from
documentation as to whether the main flow of execution is suspended at
the time of execution of the tick_function (i.e. working like a
GOTO/GOSUB) or it's actually spawning a new process with a different
timeline (thus allowing the main page to finish without killing the
tick_function as well)
Or... do I need to forget about it and call bash scripts?
thanks for your answers,
Max
--
Best regards,
Massimiliano Bariola mailto:bariola@motorcity.it
Motorcity S.p.a. +39 30 2927411
Corso Magenta 27
25100 Brescia - ITALY