News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matthew Weier O'Phinney's Blog:
Writing Gearman Workers in PHP
May 07, 2010 @ 08:11:59

Matthew Weier O'Phinney has a new post today about creating Gearman workers in PHP to be able to handle some of the more complex functionality they want surrounding the Zend Framework.

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.

0 comments voice your opinion now!
gearman worker tutorial git process


blog comments powered by Disqus

Similar Posts

Eric Lamb's Blog: Practical PHP Reflection

Brian Moon's Blog: Using ini files for PHP application settings

Felix Geisendorfer's Blog: Setting up Xdebug on Mac OS X (or Win32 / Linux)

Giorgio Sironi's Blog: The Repository pattern

WebReference.com: Controllers: Programming Application Logic


Community Events





Don't see your event here?
Let us know!


language symfony2 refactor configure threedevsandamaybe install testing opinion code podcast interview developer laravel community unittest framework list series release introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework