Download the PHP package mojiehai/queue_task without Composer
On this page you can find all versions of the php package mojiehai/queue_task. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package queue_task
queue_task
PHP队列任务管理器,支持多种存储方式
业务场景
在实际业务场景中,我们可能需要执行一些耗时操作,例如:发送邮件等。但这样的操作并不适合放在主流程中,则可以使用队列来异步处理任务。
简述
基于php-cli模式多进程的生产者-消费者模式,自定义存储介质,也可用系统内置存储:Redis/Mns/RabbitMq。
依赖
必须
- php:
>=7.0
- aliyun/aliyun-mns-php-sdk:
^1.1
- php-amqplib/php-amqplib:
^2.10
- ext-redis:
*
- ext-json:
*
非必须(多进程模式必须)
- ext-pcntl:
*
- ext-posix:
*
- swoole:
>=1.10.3
安装
linux:
composer require mojiehai/queue_task
windows:
composer require mojiehai/queue_task --ignore-platform-reqs
(忽略环境检查)(windows不支持多进程)
使用
全局配置
压入任务
- 首先定义处理类,例如:TestHandler继承JobHandler,并定义任务test方法
-
test方法接收两个参数,第一个为Job对象,第二个为自定义参数
- 压入
监听任务
-
以普通方式启动监听任务(单进程)
- 以守护进程方式启动监听任务(多进程)
All versions of queue_task with dependencies
PHP Build Version
Package Version
Requires
aliyun/aliyun-mns-php-sdk Version
^1.1
php-amqplib/php-amqplib Version ^2.10
php Version >=7.0
ext-json Version *
ext-redis Version *
ext-pcntl Version *
ext-posix Version *
php-amqplib/php-amqplib Version ^2.10
php Version >=7.0
ext-json Version *
ext-redis Version *
ext-pcntl Version *
ext-posix Version *
The package mojiehai/queue_task contains the following files
Loading the files please wait ....