bigcommerce/php-resque-pause
Composer 安装命令:
composer require bigcommerce/php-resque-pause
包简介
php-resque-pause is a PHP port of resque-pause, which adds support for pausing / unpausing Resque jobs.
README 文档
README
A PHP-Resque plugin.
resque-pause adds functionality to pause resque jobs
Using a pause allows you to stop the worker without stop the enqueue
For further information re: php-resque, visit this official repo: http://github.com/chrisboulton/php-resque
Requirements
- PHP 5.3+
- Redis 2.2+
- Composer
Getting Started
resque-pause is installed via composer. To install:
$ # Add php-resque-pause to your project's composer.json $ composer require "bigcommerce/php-resque-pause" $ # Install composer dependencies $ composer install
Usage
To use Resque Pause in your application you'll need to create a globally used instance, we use Pimple but you can use
globals, a static variable, or whatever else you like. Upon instantiation Pause will add a Resque listener to make
sure that any jobs pushed to a paused queue will be paused as well. On destruction Pause will remove said listener.
// Let's put it in a global since that's easy/familiar $GLOBALS['ResquePause'] = new \Resque\Plugins\Pause(); // Your enqueues are now being listened to
Pause it!
$GLOBALS['ResquePause']->pause('My_Queue');
Resume it!
$GLOBALS['ResquePause']->resume('My_Queue');
Is it Paused?
$GLOBALS['ResquePause']->isPaused('My_Queue');
Contributing
This repo is fairly thoroughly tested so please add tests for any feature you add. We use PSR-4 conventions and have a
linter in place. To run the linter simply run composer lint and to run the tests locally run composer test. To have
your code reviewed please tag @bigcommerce-labs/tools.
bigcommerce/php-resque-pause 适用场景与选型建议
bigcommerce/php-resque-pause 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11.15k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2015 年 03 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 bigcommerce/php-resque-pause 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bigcommerce/php-resque-pause 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 11.15k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-03-12