Plugin configuration optionsΒΆ

This plugin can be configured via your config/app.php. It works similar to how all other CakePHP engine-based libraries work (Cache, Email, Log), and as such you can have multiple backends under different names. Here is an example config stanza:

 * Configures the Queuesadilla engine to read from mysql as it's database
 * The `url` parameter is a datasource name, as supported by CakePHP and other frameworks.
 * Some examples:
 * - beanstalkd:  beanstalk://
 * - in memory:   memory:///?queue=default&timeout=1
 * - mysql:       mysql://travis@
 * - /dev/null:   null:///?queue=default&timeout=1
 * - redis:       redis://travis@
 * - synchronous: synchronous:///?queue=default&timeout=1
 * - postgres:    pgsql://postgres@
'Queuesadilla' => [
    'default' => [
        'url' => env('QUEUESADILLA_DEFAULT_URL', ''),

Note that the config array is passed as settings to the queueing engine. Please refer to the Queuesadilla docs for more information on how each engine can be configured.

Please Note:

If your job callback is performing a database involved operation, you should check if the CakePHP database connection is still alive. It can happen that your database connection timed out, when no jobs were acknowledged for a long time. A way to come around this, is to disconnect the CakePHP connection every time a job succeeded or failed.

To do so, create a subclass of the QueuesadillaShell and implement two event listeners inside the getWorker method. You can easily do that by baking a shell with bin/cake bake shell MyQueuesadilla command and alter the created class as below:

namespace App\Shell;

use Cake\Datasource\ConnectionManager;
use Josegonzalez\CakeQueuesadilla\Shell\QueuesadillaShell;

 * MyQueuesadilla shell command.
class MyQueuesadillaShell extends QueuesadillaShell

     * @param \josegonzalez\Queuesadilla\Engine\Base $engine
     * @param \Psr\Log\LoggerInterface $logger
     * @return \josegonzalez\Queuesadilla\Worker\Base
    public function getWorker($engine, $logger)
        $worker = parent::getWorker($engine, $logger);

        $worker->attachListener('Worker.job.success', function ($event) {
        $worker->attachListener('Worker.job.failure', function ($event) {

        return $worker;
  v: latest
On Read the Docs
Project Home
On GitHub

Free document hosting provided by Read the Docs.