Download the PHP package out001a/tasque without Composer
On this page you can find all versions of the php package out001a/tasque. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download out001a/tasque
More information about out001a/tasque
Files in out001a/tasque
Download out001a/tasque
More information about out001a/tasque
Files in out001a/tasque
Vendor out001a
Package tasque
Short Description Redis based library for creating background tasks and processing them later.
License MIT
Homepage http://www.github.com/out001a/tasque/
Package tasque
Short Description Redis based library for creating background tasks and processing them later.
License MIT
Homepage http://www.github.com/out001a/tasque/
Please rate this library. Is it a good library?
Informations about the package tasque
tasque 
定时优先级任务处理
背景
设计开发这个系统的初衷是为了满足实际业务中对各种异步延时任务的处理需求:
- 定时
任务可以在指定的时间自动执行 - 重试
任务执行失败时,需要根据指定的规则在特定的时间间隔后重试,直到执行成功或规则结束为止 - 时间要求是秒级
架构
使用
-
加载
-
执行
composer require out001a/tasque
, 或者将依赖添加到项目的composer.json
文件中,然后执行
composer install
或composer update
- 在代码中添加
-
- 示例
tests/bin/test.php
是创建任务并入队的例子tests/bin/monitor.php
是后台进程分发并处理任务的例子
简介
包含三个相对独立的组件:进程、任务和优先级队列。
-
进程
进程组件在
src/Process
目录下,在我之前的一个小项目php-process的基础上做了些改进,可以满足在生产环境中使用。用法如下:
-
任务
在
src/Task
目录下,实现了一个抽象的基础任务类和任务需要重试时应抛出的异常。业务开发时应该基于抽象类实现自己的任务处理逻辑。 -
优先级队列
src/Tasque.php
,基于redis实现了入队、出队等操作。出队按照队列元素的score值从小到大进行。
单元测试
TODO
- redis断线重连处理
- 支持平滑重启
- inotify监控指定文件的变化并自动重启进程
- 加入日志组件
- 使用环境变量控制各种参数
- Web控制台
All versions of tasque with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0
ext-pcntl Version *
ext-sysvmsg Version *
ext-redis Version >=3.1.0
ext-pcntl Version *
ext-sysvmsg Version *
ext-redis Version >=3.1.0
The package out001a/tasque contains the following files
Loading the files please wait ....