O'Reilly logo

CakePHP 2 Application Cookbook by Jorge González, James Watts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Event stacking

Once we have the events in place, we could start thinking about dispatching events to an event queue to let another one process, possibly in a different server, pick up the payload, and process the task. This is a useful technique to move your background processing away from the runtime process, thus giving faster response times and allowing resource-intensive jobs to be queued and executed by an optimized server.

In this recipe, we're going to use the CakeResque plugin to create a job queue, using Redis and a worker to process your tasks.

Getting ready

First, make sure you have Redis 2.2 or later installed. Check the detailed setup instructions in the Redis documentation at http://redis.io/.

Then, download and install the CakeResque ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required