ilzrv / php-bull-queue
PHP Job Creator For Bull Queue
Installs: 4 430
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 1
Forks: 4
Open Issues: 2
pkg:composer/ilzrv/php-bull-queue
Requires
- php: ^7.4|^8.0
- ramsey/uuid: ^4.1
This package is auto-updated.
Last update: 2025-09-26 22:46:06 UTC
README
At the moment this library provides the ability to add jobs to the Bull Queue.
Requirements
- PHP 7.4+
- PhpRedis (default) or Predis
- ramsey/uuid
Installation
You can install the package via composer:
composer require ilzrv/php-bull-queue
Usage
To add a job to the queue, you can use the following example:
<?php use Ilzrv\PhpBullQueue\Queue; $videoQueue = new Queue('videoQueue'); $videoQueue->add(Queue::DEFAULT_JOB_NAME, [ 'video' => 'http://example.com/video1.mov' ]);
If you want to use predis as Redis client (example configuration):
<?php use Ilzrv\PhpBullQueue\Queue; use Ilzrv\PhpBullQueue\DTOs\QueueOpts; use Ilzrv\PhpBullQueue\DTOs\RedisConfig; $videoQueue = new Queue( 'videoQueue', new QueueOpts([ 'redis' => new RedisConfig([ 'client' => 'predis', 'host' => '127.0.0.1', 'port' => 6379, 'password' => '', ]), ]) ); $videoQueue->add(Queue::DEFAULT_JOB_NAME, [ 'video' => 'http://example.com/video1.mov' ]);
Configurations
All is configured via classes:
Ilzrv\PhpBullQueue\DTOs\RedisConfigIlzrv\PhpBullQueue\DTOs\QueueOptsIlzrv\PhpBullQueue\DTOs\JobOpts
RedisConfig
client(string) Redis client. Can bephpredisorpredis. Default:phpredishost(string) Redis host. Default:127.0.0.1port(int) Redis port. Default:6379password(string) Redis password. Default:''
QueueOpts
redis(RedisConfig Object) Redis Configuration.prefix(string) Queue prefix. Default:bull
JobOpts
customJobId(string) Custom JobId. Default:0priority(int) Job priority. Default:0lifo(bool) Last In, First Out. Default:falseattempts(int) Job attempts. Default:1timestamp(int) Current timestamp.delay(int) Job delay. Default:0
License
The MIT License (MIT). Please see License File for more information.