• Stars
    star
    304
  • Rank 137,274 (Top 3 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 13 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Queue plugin for CakePHP - simple, pure PHP and without dependencies.

CakePHP Queue Plugin

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

This branch is for use with CakePHP 4.3+. For details see version map.

Background

This is a very simple and minimalistic job queue (or deferred-task) system for CakePHP. If you need a very basic PHP internal queue tool, this is definitely an option. It is also 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. You can also easily provide progress and status information into your pages.

Please also read my blog posts about deferred execution and real-life example usage [new]. For more high-volume and sophisticated use cases please see the awesome list alternatives.

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.

Another important reason is that specific jobs can be (auto)retried if they failed. So if the email server didn't work the first time, or the API gateway had an issue, the current job to be executed isn't lost but kept for rerun. Most of those external services should be treated as failable once every x calls, and as such a queue implementation can help reducing issues due to such failures. If a job still can't finish despite retries, you still have the option to debug its payload and why this job cannot complete. No data is lost here.

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

Demo

See Sandbox app.

Installation and Usage

See Documentation.

More Repositories

1

cakephp-tools

A CakePHP Tools plugin containing lots of useful helpers, behaviors, components, shells, ...
PHP
336
star
2

cakephp-ide-helper

IDE Helper plugin for CakePHP
PHP
182
star
3

media-embed

A PHP library to deal with all those media services around, parsing their URLs and displaying their audios/videos.
PHP
175
star
4

cakephp-tinyauth

CakePHP TinyAuth plugin for an easy and fast user authentication and authorization. Single or multi role. DB or config file based.
PHP
128
star
5

cakephp-sandbox

A CakePHP Sandbox app to test and showcase misc. features and tools.
PHP
59
star
6

cakephp-ajax

AJAX for CakePHP: A plugin to ease handling AJAX requests.
PHP
57
star
7

cakephp-geo

A CakePHP plugin around geocoding tools and helpers.
PHP
47
star
8

CakePHP-DatabaseLog

DatabaseLog CakePHP plugin to log into DB instead of files. Better to filter and search.
PHP
43
star
9

cakephp-shim

CakePHP plugin to "shim" functionality up and down for major versions of the framework.
PHP
37
star
10

cakephp-hashid

CakePHP plugin to use hashids for your database table lookups
PHP
36
star
11

cakephp-upgrade

Enhanced Upgrade Plugin for CakePHP2.x (Upgrade from 1.x up to 2.3 or even 3.0)
PHP
36
star
12

cakephp-setup

CakePHP Setup Plugin - containing useful management and debugging tools for CakePHP apps
PHP
34
star
13

cakephp-cache

CakePHP Cache plugin for caching views as static cache files.
PHP
32
star
14

cakephp-dto

CakePHP DTO plugin - quickly generate useful data transfer objects for your app (mutable/immutable)
PHP
24
star
15

executionorder

A demo app to display dispatching and execution order of files and callbacks in a CakePHP app. Try it out!
PHP
21
star
16

composer-prefer-lowest

Checks prefer-lowest installation for actually defined min versions in composer.json
PHP
20
star
17

cakephp-translate

A CakePHP plugin to manage translations of your static content the easy way via web backend.
PHP
17
star
18

cakephp-calendar

CakePHP plugin to render simple calendars or ical/ics files
PHP
16
star
19

CakePHP-Payment-Plugin

Plugin for Payments with Bitcoin, ...
PHP
16
star
20

cakephp-tags

CakePHP Tags Plugin
PHP
14
star
21

cakephp-transifex

A CakePHP plugin to manage locales/translations via Transifex API
PHP
14
star
22

cakephp-whoops

Whoops Error Handler for CakePHP - PHP errors and exceptions for cool kids
PHP
13
star
23

cakephp-feed

CakePHP Plugin with RssView to create RSS feeds.
PHP
13
star
24

cakephp-data

CakePHP Data plugin
PHP
12
star
25

cakephp-flash

A CakePHP Flash plugin for more powerful flash messages
PHP
12
star
26

cakefest

A fun/test project around the annual CakePHP CakeFest Conference.
HTML
10
star
27

cakephp-captcha

Dead simple, unobtrusive and extendable captcha solution for CakePHP
PHP
10
star
28

cakephp-ratings

Ratings Plugin for CakePHP
PHP
9
star
29

cakephp-expose

CakePHP Expose plugin to expose entities through additional UUIDs instead of their AIID primary keys
PHP
8
star
30

cakephp-decimal

CakePHP Decimal type handling using Decimal value object.
PHP
8
star
31

cakephp-test-helper

Helper plugin around CakePHP testing and TDD as browser backend
PHP
7
star
32

cakephp-meta

CakePHP Meta plugin for managing meta tags and SEO related HTML header markup.
PHP
7
star
33

cakephp-feedback

A CakePHP plugin for direct feedback or bugreport (with screenshot!) tab option in your app.
PHP
6
star
34

cakephp-queue-scheduler

CakePHP Addon for Queue plugin to schedule commands and queue tasks as crontab like DB solution
PHP
6
star
35

cakephp-qrcode

QR Code Plugin for CakePHP
PHP
6
star
36

cakephp-file-storage

Abstract file storage and upload plugin for CakePHP. Write to local disk, FTP, S3, Dropbox and more through a single interface. It's not just yet another uploader but a complete storage solution.
PHP
4
star
37

cakephp-math

Math Plugin for CakePHP
PHP
3
star
38

cakephp-markup

CakePHP plugin for markup (parsing and displaying)
PHP
3
star
39

cakephp-tinyauth-backend

A database driven backend for CakePHP TinyAuth plugin
PHP
2
star
40

auth-demo

CakePHP Demo Application for Authentication and Authorization plugins, based on TinyAuth wrapper
PHP
2
star
41

cakephp-menu

Powerful Menu plugin for CakePHP
PHP
2
star
42

cakephp-ide-helper-extra

IdeHelper task and addon collection
SCSS
2
star
43

cakephp-templating

A plugin for templating in CakePHP with HTML value objects, font-icons and useful helpers
PHP
2
star
44

cakephp-trailing-slash

Legacy support for Cake apps that still use/need trailing slash routing
PHP
1
star
45

cakephp-navigation

Navigation plugin for CakePHP, including sitemap, menu and breadcrumb generation
PHP
1
star
46

PHP

PHP draft for argument order fix
PHP
1
star
47

cakephp-opensearch

CakePHP Open Search plugin/helper for creating installable search plugins for IE, Firefox and Chrome
PHP
1
star
48

cakephp-favorites

Favorites Plugin for CakePHP
PHP
1
star
49

cakephp-comments

Comments Plugin for CakePHP
PHP
1
star
50

sandbox-docker

Docker container setup for the CakePHP sandbox
Dockerfile
1
star