So we have this requirement in our project to start up a “thread” of execution asynchronously.
First we had to come to an agreement that it can’t be done with multi-threading, but instead has to be done with multiple processes. We can’t have our controller executing a thread, and waiting around for it to finish in memory.
This will leave a process living on the system that we don’t necessarily need. Although now that I think about it, it may have the visual effect of fulfilling our requirement, its not a good overall design.
What we really need is to start an external process that will execute not as a child of the current process.So we have tried it a couple of different ways.
pcntl_fork which doesnt work with Apache php module, so we have to redeploy as a FastCGI.
system() call sending the shell into the background, which seems to be not working right now.
And the two things I coded in but never tested, proc_open and popen.
Now we are not trying to achieve true parallel processing, and utitlizing the computer’s multiple processes. Just a simple outside process.
Stay tuned, we’ll let you know.
_______________
The answer was popen with &> dev/null & in the command string.