Introduction
BullMQ PHP client for adding jobs to queues.
The PHP package provides a Queue client that allows you to add jobs to BullMQ queues from your PHP applications. These jobs can then be processed by workers written in Node.js, Python, or Elixir.
Installation
This package is distributed directly from the BullMQ monorepo. Add the repository to your composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/taskforcesh/bullmq"
}
],
"require": {
"taskforcesh/bullmq-php": "dev-master"
},
"minimum-stability": "dev",
"prefer-stable": true
}Then run:
composer installOr add it to an existing project via command line:
Requirements
PHP 8.1 or higher
Redis 5.0 or higher (6.2+ recommended)
Composer
Get started
You can add jobs to a queue like this:
Job Options
You can pass various options when adding jobs:
Adding Multiple Jobs
Queue Management
Interoperability
Jobs added with the PHP client are fully compatible with BullMQ workers in:
Node.js - Using the official BullMQ package
Python - Using the BullMQ Python package
Elixir - Using the BullMQ Elixir package
Example Node.js worker that processes jobs added from PHP:
Connection Options
Retry and Promote Jobs
Note on Job Schedulers: Repeatable/scheduled jobs (cron patterns) should be created from the Node.js side using JobScheduler. The PHP client is designed for adding individual jobs, not managing schedulers.
More Information
For more details, see the PHP README on GitHub.
Last updated
Was this helpful?