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.

The PHP package only implements the Queue class (producer side). Workers are not included as PHP's execution model is not well-suited for long-running worker processes. Use Node.js, Python, or Elixir workers to process the jobs.

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 install

Or 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:

Example Node.js worker that processes jobs added from PHP:

Connection Options

Retry and Promote Jobs

More Information

For more details, see the PHP README on GitHub.

Last updated

Was this helpful?