I\'m actually trying to apply this to a script that sends email. The sending email part takes a few seconds which is too long. What I want is for the first script to do its
What you want to use is something called beanstalkd
Details: How can I get a list of all jobs in a beanstalk tube?
It will allow you to queue up jobs (do 1, then 2, then 3. then 4) you can even distribute these tasks across servers (yes for php jobs!).