A lightweight showcase of Laravel-style job queues in plain PHP, backed by Redis.
- PHP >= 8.3
- Redis
- Composer
composer installThe hobbyist is the worker process that listens on a queue and processes hobbies as they arrive.
# listen on the default queue
php hobbyist.php
# listen on a specific queue
php hobbyist.php emailsrequire_once __DIR__ . '/vendor/autoload.php';
use hobbies\LogMessageHobby;
$dispatcher = new src\Dispatcher(new Predis\Client());
// dispatches to whichever queue the hobby declares via #[OnQueue]
$dispatcher->dispatch(new LogMessageHobby('Hello from the queue!'));