Download the PHP package gensart-x/bullmq-php without Composer
On this page you can find all versions of the php package gensart-x/bullmq-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gensart-x/bullmq-php
More information about gensart-x/bullmq-php
Files in gensart-x/bullmq-php
Package bullmq-php
Short Description BullMQ Queue client for PHP - Schedule jobs to be processed by BullMQ workers
License MIT
Homepage https://bullmq.io
Informations about the package bullmq-php
All source codes belong to BullMQ, i am just publishing this to composer.
BullMQ PHP
A PHP client library for BullMQ, the modern queue system for Node.js.
This library allows you to add jobs to a BullMQ queue from your PHP application. The jobs can then be processed by workers written in Node.js, Python, or Elixir.
Requirements
- PHP 8.1 or higher
- Redis 5.0 or higher (6.2+ recommended)
- Composer
Installation
This package is distributed directly from the BullMQ monorepo. Add the repository to your composer.json and require the package:
Then run:
Or add it to an existing project:
Note: Stable releases are tagged with the format
vphp{version}(e.g.,vphp1.0.0). Check the releases page for available versions.
Quick Start
Creating a Queue
Adding Jobs
Job Options
Adding Multiple Jobs
Getting Job Information
Queue Management
Parent-Child Jobs (Flows)
Job States
Jobs can be in one of the following states:
waiting- Job is waiting to be processedactive- Job is currently being processeddelayed- Job is delayed and waiting for its delay to expirecompleted- Job has been successfully processedfailed- Job has failed after all retry attemptspaused- Job is in a paused queueprioritized- Job is in the prioritized setwaiting-children- Parent job waiting for child jobs to complete
Connection Options
Interoperability
Jobs added with this PHP library can be processed by 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:
Error Handling
Testing
License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
API Reference
Queue Methods
| Method | Description |
|---|---|
add(name, data, opts) |
Add a single job to the queue |
addBulk(jobs) |
Add multiple jobs in a single operation |
getJob(id) |
Get a job by its ID |
getJobs(jobIds) |
Get multiple jobs by their IDs |
getJobsByType(types, start, end, asc) |
Get jobs by type(s) with pagination |
getJobState(id) |
Get the current state of a job |
getJobCounts() |
Get job counts for all states |
getJobCountByTypes(...types) |
Get total count for specific types |
getCountsPerPriority(priorities) |
Get counts grouped by priority |
getWaiting(start, end) |
Get waiting jobs |
getActive(start, end) |
Get active jobs |
getDelayed(start, end) |
Get delayed jobs |
getPrioritized(start, end) |
Get prioritized jobs |
getCompleted(start, end) |
Get completed jobs |
getFailed(start, end) |
Get failed jobs |
pause() |
Pause the queue |
resume() |
Resume the queue |
isPaused() |
Check if queue is paused |
remove(jobId) |
Remove a specific job |
clean(grace, limit, type) |
Clean old jobs |
drain(delayed) |
Remove all waiting/delayed jobs |
obliterate(opts) |
Remove all queue data |
retryJobs(opts) |
Retry failed/completed jobs |
promoteJobs(opts) |
Promote delayed jobs to waiting |
close() |
Close the connection |
Job Options
| Option | Type | Description |
|---|---|---|
jobId |
string | Custom job ID |
delay |
int | Delay in milliseconds before processing |
priority |
int | Priority (lower = higher priority) |
attempts |
int | Number of retry attempts |
backoff |
array/int | Backoff strategy for retries |
lifo |
bool | Process newest jobs first |
removeOnComplete |
bool/int/array | Remove job on completion |
removeOnFail |
bool/int/array | Remove job on failure |
timestamp |
int | Job creation timestamp (ms) |
parent |
array | Parent job reference for flows |
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.
Links
All versions of bullmq-php with dependencies
predis/predis Version ^2.0
ramsey/uuid Version ^4.7
rybakit/msgpack Version ^0.9