News Feed
Sections




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

SitePoint PHP Blog:
Introduction to Gearman - Multitasking in PHP
November 04, 2013 @ 13:23:11

The SitePoint PHP blog has posted an introductory tutorial showing you how to use Gearman in PHP to handle multitasking outside of the normal script execution. Gearman is an external job server that lets you schedule scripts and tasks for execution.

How many times have you developed a web application that had some functionality which would benefit from running an external program or even forking a separate process? This is not something you generally like to do from your web app because you want to make it run as fast and efficient as possible, while keeping the site functional for end users. So how do we get a fast but full-featured application that can process more than the average app we're used to?

They start by introducing you to Gearman - the server side - and how it works to handle a large amount of jobs quickly (50 thousand per second according to the article). They give the example of resizing images uploaded by users to illustrate. Next up is the installation - first Gearman then on to the PHP side, installing the PECL extension and adding it to the php.ini configuration. An example script is also provided showing how to create a new connection to Gearman and configure the callbacks for handling status changes. They also include adding two kinds of tasks - a normal one and a low priority one.

0 comments voice your opinion now!
tutorial gearman introduction install configure process task

Link: http://www.sitepoint.com/introduction-gearman-multi-tasking-php/

blog comments powered by Disqus

Similar Posts

ZendCasts.com: Painless HTML Emails with Zend_Mail

PHPMaster.com: Working with Multibyte Strings

SocialDevelopers.net: Facebook and the Zend Framework - Part 1: Iframe Authentication

PHPMaster.com: Bulletproofing Database Interactions with PHPUnit's Database Extension

SocialGeek.be: Clean urls through readable slugs in PHP


Community Events





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


conference community library version release series symfony interview podcast security tool list framework language composer voicesoftheelephpant opinion introduction artisanfiles laravel

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