marlonfan/disque-php
Composer 安装命令:
composer require marlonfan/disque-php
包简介
PHP library for Disque, an in-memory, distributed job queue
README 文档
README
A PHP library for the very promising disque distributed job queue. Features:
- Support for both PHP (5.5+) and HHVM
- No dependencies: Fast connection to Disque out-of-the-box
- High level API to easily push jobs to a queue, and retrieve jobs from queues
- Easily schedule jobs for execution at a certain
DateTime - Use the built in
Jobclass, or implement your own - Smart node connection support based on number of jobs produced by nodes
- Connect to Disque with the built-in connection, or reutilize your existing Redis client (such as predis)
- Supporting all current Disque commands, and allows you to easily implement custom commands
- Fully unit tested
Installation
$ composer require mariano/disque-php --no-dev
If you want to run its tests remove the --no-dev argument.
Usage
This library provides a Queue API for easy job pushing/pulling, and direct access to all Disque commands via its Client API.
Create the client:
use Disque\Connection\Credentials; use Disque\Client; $nodes = [ new Credentials('127.0.0.1', 7711), new Credentials('127.0.0.1', 7712, 'password'), ]; $disque = new Client($nodes);
Queue a job:
$job = new \Disque\Queue\Job(['name' => 'Claudia']); $disque->queue('my_queue')->push($job);
Schedule job to be processed at a certain time:
$job = new \Disque\Queue\Job(['name' => 'Mariano']); $disque->queue('my_queue')->schedule($job, new \DateTime('+2 hours'));
Fetch queued jobs, mark them as processed, and keep waiting on jobs:
$queue = $disque->queue('my_queue'); while ($job = $queue->pull()) { echo "GOT JOB!"; var_dump($job->getBody()); $queue->processed($job); }
For more information on the APIs provided, read the full documentation.
Testing
$ phpunit
Contributing
Please see CONTRIBUTING for details.
Support
If you need some help or even better want to collaborate, feel free to hit me on twitter: @mgiglesias
Security
If you discover any security related issues, please contact @mgiglesias instead of using the issue tracker.
Acknowledgments
First and foremost, Salvatore Sanfilippo for writing what looks to be the definite solution for job queues (thanks for all the fish Gearman).
Other disque client libraries for the inspiration.
The PHP League for an awesome README.md skeleton,
and tips about packaging PHP components.
A special acknolewdgment and appreciation for our amazing contributors!
License
The MIT License (MIT). Please see License File for more information.
marlonfan/disque-php 适用场景与选型建议
marlonfan/disque-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 596 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 06 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「queue」 「job」 「disque」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 marlonfan/disque-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 marlonfan/disque-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 marlonfan/disque-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP library for Disque, an in-memory, distributed job queue
PHP AMQP Binding Library
Provides a possibility to auto-setup crontabs required for project based on configuration file.
SlimQ Enables You to push jobs to background workers
A Laravel package to monitor queue jobs.
PHP client for Kue priority job queue API
统计信息
- 总下载量: 596
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-19