A minimalistic JobQueue Plugin for CakePHP - maintained version.
Clone or download
Latest commit 464ab3d Oct 6, 2018
Failed to load latest commit information.
config Fix cs Sep 22, 2018
docs Docs Aug 15, 2018
src Fixing date Aug 27, 2018
tests Fix tests Oct 6, 2018
.editorconfig editorconfig Feb 18, 2016
.gitattributes Fix export of test_app folder Dec 23, 2017
.gitignore Rename QueuedTasks to QueuedJobs Nov 22, 2016
.travis.yml Fix up phpstan. Jul 3, 2018
LICENSE Upgrade and fix tests Sep 26, 2013
README.md Raise limit to 3.6+ Jul 3, 2018
composer.json Raise limit to 3.6+ Jul 3, 2018
phpunit.xml.dist fix test suite name Apr 19, 2018


CakePHP Queue Plugin

Build Status Coverage Status Latest Stable Version Minimum PHP Version License Total Downloads Coding Standards

This branch is for use with CakePHP 3.6+.


This is a very simple and minimalistic job queue (or deferred-task) system for CakePHP. It is a great tool for demo purposes on how queues work and doesn't have any dependencies.

Overall functionality is inspired by systems like Gearman, Beanstalk or dropr, but without any illusion to compete with these more advanced Systems.

The plugin is an attempt to provide a basic, simple to use method to enable deferred job execution, without the hassle of setting up or running an extra queue daemon, while integrating nicely into CakePHP and also simplifying the creation of worker scripts.

Please also read the blog post. For more high-volume and robust use cases please see the awesome list.

Why use deferred execution?

Deferred execution makes sense (especially in PHP) when your page wants to execute tasks, which are not directly related to rendering the current page. For instance, in a BBS-type system, a new users post might require the creation of multiple personalized email messages, notifying other users of the new content. Creating and sending these emails is completely irrelevant to the currently active user, and should not increase page response time. Another example would be downloading, extraction and/or analyzing an external file per request of the user. The regular solution to these problems would be to create specialized cronjobs which use specific database states to determine which action should be done.

The Queue plugin provides a simple method to create and run such non-user-interaction-critical tasks.

While you can run multiple workers, and can (to some extent) spread these workers to different machines via a shared database, you should seriously consider using a more advanced system for high volume/high number of workers systems.

Installation and Usage

See Documentation.