定制 scones/resque 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

scones/resque

Composer 安装命令:

composer require scones/resque

包简介

resque (for php) is a Redis-backed library for creating background jobs, placing them on multiple queues, and processing them later. compatible to the original http://resque.github.io/

README 文档

README

Build Status Scrutinizer Code Quality Code Coverage

Resque

PHP implementation of the resque mechanism.

This is a completely new implementation featuring things as

  • no static methods
  • minimalistic dependencies (only core features for the asynchronous task processing)
  • good coding standards
  • psr events as tasks, thus the behavior can be modified
  • strict typing

Install

In most cases it should suffice to just install it via composer.

composer require scones/resque "*@stable"

How does it work?

The resque task processing is a decentral queueing system. (read: no master server or similar) There are two parts to the processing, pushing jobs and working job. Those should not run in the same application or at least process to gain the most benefit from it.

pushing jobs

The first step to process a job is to put it on the queue. Assuming you have the resque class already instantiated, you'd be just calling $resque->enqueue('SomeClass', ['some' => 'data'], 'some_queue')

This method puts the task on the queue and returns. It will not process it, as it is not its job. The data is stored (in a very precise format) in a redis database.

working jobs

The second step to process a job is the worker. The worker is an process running anywhere with access to the same redis database.

The worker waits new entries in the configured queues and fetches one, as soon as it's available. When this happens, it builds the corresponding class (from the supplied container/servicelocator, see examples) and invokes perform with the array provided in enqueue as arguments.

Examples

Find runnable usage examples under https://github.com/scones/resque-examples

统计信息

  • 总下载量: 90
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固