Skip to content

Solo Job QueueDatabase-Backed Job Queue for PHP

Leased claims with ownership tokens, a retry policy stored with every job, deadlines, and a worker daemon on Doctrine DBAL.

Solo Job Queue

Quick Example โ€‹

php
use Solo\JobQueue\JobQueue;
use Solo\JobQueue\Codec\ContainerJobCodec;
use Solo\JobQueue\Storage\{DbalJobStorage, Schema};
use Solo\JobQueue\Worker\Worker;

Schema::install($connection);

$queue = new JobQueue(
    storage: new DbalJobStorage($connection),
    codec: new ContainerJobCodec($container),
);

$queue->push(new SendEmailJob('user@example.com', 'Welcome'), 'email');

// In a long-running process: claim, run and acknowledge one job at a time.
(new Worker($queue, type: 'email'))->run();

Installation โ€‹

bash
composer require solophp/job-queue

Requirements: PHP 8.3+, ext-mbstring, Doctrine DBAL 4, and MySQL 8+, MariaDB 10.6+, PostgreSQL or SQLite 3.35+

Released under the MIT License.