Hiya,
I'm trying to have a foreground process to generate an HTTP request to a background process.
The idea is that the background process will start and terminate whenever it's done it's thing.
The foreground process should not wait for the background process to finish, in fact, it should not wait for anything 😉
It needs to be done over HTTP as we won't know if foreground and background will be on the same server (all we know is that they need a common DB table).
I've tried things like:
if($rFile = fopen("http://server/file.php", "r")) {
stream_set_timeout($rFile, 0, 1);
$sConfirmation = fread($rFile, 32); // Read the first line of the script.
fclose($rFile);
return TRUE;
} else {
// Could not open file for reading.
return FALSE;
}
But whatever I seem to do, the request doesn't seem to want to be closed ASAP.
Anyone got any tips?! Thanks!