News Feed
Sections




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

Justin Carmony's Blog:
PHP Workers with Redis & Solo
January 11, 2012 @ 11:50:52

In this latest post to his blog Justin Carmony shares some of his experience using Redis and Solo to asynchronously run queries and return data without the user having to wait.

Sometimes there are situations when you want to parallel process things. Other times you might have a list of tasks to accomplish, and you don't want to make the user wait after pressing a button. This is where "Workers" can come in. They are independent scripts that run along side of your application, performing tasks, or "jobs."

Solo is a very basic Perl script that ensures only one process of a type is running at once. Using this and a PHP library called predis, he shows how to set up workers and add items to your processing queue. The workers themselves run on a cron job and connect to the queue server to see what they need to do. He also throws in some "bells and whistles" - extras that can enhance your worker system: queue monitoring, version numbering and killing workers based on a hash value.

His code examples are posted on his github account and a screencast is included in the post to show the system in action.

0 comments voice your opinion now!
redis solo cron tutorial queue worker


blog comments powered by Disqus

Similar Posts

The Bakery - Rails-Like Validation, Elistic, Textile, and a CakePHP Release

Chris Jones: Using the PHP CLI Webserver to Identify and Test Memory Issues in PHP

php|architect: Stored Procedure Programming for MySQL5 (Part 1)

SitePoint PHP Blog: Social Network Authentication - Setup & Google+

SitePoint PHP Blog: Sending Confirmation Emails with Phalcon and Swift


Community Events

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


threedevsandamaybe community extension voicesoftheelephpant release security library series framework podcast laravel symfony laravel5 api language opinion introduction interview version unittest

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