In my persute of being able to asynchronously execute PHP scripts, I cam across a program called Gearman. “Gearman provides a generic application framework to farm out work to other machines or processes that are better suited to do the work. It allows you to do work in parallel, to load balance processing, and to call functions between languages.” (from the gearman.org). Using Gearman, I was able to develop worker scripts that were tasked with executing long running jobs on distributed servers. Those jobs are triggered using a simple client API via the PEAR package Net_Gearman. This new ability was a huge win for my company and a partner company I work with. IF you are looking for a way to break jobs OUT of the HTTP request, Gearman is a great way to go!
Having used PHP for years, I’ve run into most of its limitations. One in particular that has been bothering me is the fact that php web applications are bound to the HTTP request. I want to start experimenting with asynchronous PHP. I think this will mean that I’ll need to build or adopt a kind of process server that I can farm out work to. I’ll also have to standardize what a “worker” will look like, and be able to track jobs throughout their lifecycle. Should be fun!