ilzrv/php-bull-queue
Composer 安装命令:
composer require ilzrv/php-bull-queue
包简介
PHP Job Creator For Bull Queue
README 文档
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.
ilzrv/php-bull-queue 适用场景与选型建议
ilzrv/php-bull-queue 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.33k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2020 年 11 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 ilzrv/php-bull-queue 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ilzrv/php-bull-queue 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7.33k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-11-11