kamisama/php-resque-ex 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kamisama/php-resque-ex

最新稳定版本:1.3.0

Composer 安装命令:

composer require kamisama/php-resque-ex

包简介

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

README 文档

README

Resque is a Redis-backed library for creating background jobs, placing those jobs on multiple queues, and processing them later.

Background

Php-Resque-Ex is a fork of php-resque by chrisboulton. See the original README for more informations.

Additional features

This fork provides some additional features :

Support of php-redis

Autodetect and use phpredis to connect to Redis if available. Redisent is used as fallback.

Powerfull logging

Instead of piping STDOUT output to a file, you can log directly to a database, or send them elsewhere via a socket. We use Monolog to manage all the logging. See their documentation to see all the available handlers.

Log infos are augmented with more informations, and associated with a workers, a queue, and a job ID if any.

Job creation delegation

If Resque_Job_Creator class exists and is found by Resque, all jobs creation will be delegated to this class.

The best way to inject this class is to include it in you APP_INCLUDE file.

Class content is :

class Resque_Job_Creator { public static function createJob($className, $args) { // $className is you job class name, the second arguments when enqueuing a job // $args are the arguments passed to your jobs // Instanciate your class, and return the instance return new $className(); } }

This is pretty useful when your autoloader can not load the class, like when classname doesn't match its filename. Some framework, like CakePHP, uses PluginName.ClassName convention for classname, and require special handling before loading.

Failed jobs logs

You can easily retrieve logs for a failed jobs in the redis database, their keys are named after their job ID. Each failed log will expire after 2 weeks to save space.

Command Line tool

Fresque is shipped by default to manage your workers. See Fresque Documentation for usage.

Installation

Clone the git repo

$ git clone git://github.com/wa0x6e/php-resque-ex.git 

cd into the folder you just cloned

$ cd ./php-resque-ex 

Download Composer

$ curl -s https://getcomposer.org/installer | php 

Install dependencies

$ php composer.phar install 

Warning

php-resque requires the pcntl php extension, not available on Windows platform. Composer installation will fail if you're trying to install this package on Windows machine. If you still want to continue with the installation at your own risk, execute the composer install command with the --ignore-platform-reqs option.

Usage

Logging

Use the same way as the original port, with additional ENV :

  • LOGHANDLER : Specify the handler to use for logging (File, MongoDB, Socket, etc …). See Monolog doc for all available handlers. LOGHANDLER is the name of the handler, without the "Handler" part. To use CubeHandler, just type "Cube".
  • LOGHANDLERTARGET : Information used by the handler to connect to the database. Depends on the type of loghandler. If it's the RotatingFileHandler, the target will be the filename. If it's CubeHandler, target will be a udp address. Refer to each Handler to see what type of argument their __construct() method requires.
  • LOGGING : This environment variable must be set in order to enable logging via Monolog. i.e LOGGING=1

If one of these two environement variable is missing, it will default to RotatingFile Handler.

Redis backend

  • REDIS_BACKEND : hostname of your Redis database
  • REDIS_DATABASE : To select another redis database (default 0)
  • REDIS_NAMESPACE : To set a different namespace for the keys (default to resque)
  • REDIS_PASSWORD : If your Redis backend needs authentication

Requirements

  • PHP 5.3+
  • Redis 2.2+

Contributors

kamisama/php-resque-ex 适用场景与选型建议

kamisama/php-resque-ex 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 749.94k 次下载、GitHub Stars 达 139, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「redis」 「queue」 「php」 「background」 「resque」 「job」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 kamisama/php-resque-ex 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 kamisama/php-resque-ex 我们能提供哪些服务?
定制开发 / 二次开发

基于 kamisama/php-resque-ex 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 749.94k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 140
  • 点击次数: 27
  • 依赖项目数: 13
  • 推荐数: 1

GitHub 信息

  • Stars: 139
  • Watchers: 22
  • Forks: 92
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04