Download the PHP package mice-tm/yii2-queue without Composer
On this page you can find all versions of the php package mice-tm/yii2-queue. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mice-tm/yii2-queue
More information about mice-tm/yii2-queue
Files in mice-tm/yii2-queue
Package yii2-queue
Short Description Package base on yii2-queue with some improvements
License MIT
Informations about the package yii2-queue
Yii2 Queue Extension
An extension for running tasks asyncronously via queues.
It supported queues based on DB, Redis, RabbitMQ, Beanstalk and Gearman.
Added delayed queue support for AMQP and health-checks for queues
Fork of https://github.com/yiisoft/yii2-queue
Installation
The preferred way to install this extension is through composer.
Update composer.json
1) add to the require section of your composer.json
file,
2) then add a repositories section of your composer.json
file.
Basic Usage
Each task which is sent to queue should be defined as a separate class. For example, if you need to download and save a file the class may look like the following:
Here's how to send a task into queue:
Pushes job into queue that run after 5 min:
The exact way task is executed depends on the driver used. The most part of drivers can be run using console commands, which the component registers in your application.
Command that obtains and executes tasks in a loop until queue is empty:
Command launches a daemon which infinitely queries the queue:
See documentation for more details about driver console commands and their options.
The component has ability to track status of a job which was pushed into queue.
All versions of yii2-queue with dependencies
yiisoft/yii2 Version ^2.0.12
yiisoft/yii2-queue Version ^2.0
php-amqplib/php-amqplib Version ~2.7