We're looking at migrating to Git for our primary development on the framework. There are a lot of use cases we need to accommodate [...] Git allows you to define "hooks", scripts that are run at various points of the git commit lifecycle. One hook that can run on the server is called "post-receive". [...] And now we get to Gearman. I realized I could have my post-receive script queue a background task to Gearman. Since this is almost an instantaneous operation, it meant that my hook was completed before Gearman started a worker; if it wasn't, I could always do a sleep() within my worker to ensure it was.
He uses the gearman PECL extension to interface with the Gearman backend service and shows how to push off his post-recieve and rss processes to be handled separately from the current process. He includes the PHP code for both of these processes as well as the actual worker process.