2017 © Pedro Peláez
 

yii2-extension yii2-queue

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

image

f1r3starter/yii2-queue

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  • Tuesday, April 17, 2018
  • by f1r3starter
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 169 Forks
  • 0 Open issues
  • 29 Versions
  • 0 % Grown

The README.md

, (*1)

Yii2 Queue Extension


An extension for running tasks asynchronously via queues., (*2)

It supports queues based on DB, Redis, RabbitMQ, AMQP, Beanstalk and Gearman., (*3)

Documentation is at docs/guide/README.md., (*4)

Latest Stable Version Total Downloads Build Status, (*5)

Installation

The preferred way to install this extension is through composer., (*6)

Either run, (*7)

php composer.phar require --prefer-dist yiisoft/yii2-queue

or add, (*8)

"yiisoft/yii2-queue": "~2.0.0"

to the require section of your composer.json file., (*9)

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:, (*10)

class DownloadJob extends BaseObject implements \yii\queue\JobInterface
{
    public $url;
    public $file;

    public function execute($queue)
    {
        file_put_contents($this->file, file_get_contents($this->url));
    }
}

Here's how to send a task into the queue:, (*11)

Yii::$app->queue->push(new DownloadJob([
    'url' => 'http://example.com/image.jpg',
    'file' => '/tmp/image.jpg',
]));

To push a job into the queue that should run after 5 minutes:, (*12)

Yii::$app->queue->delay(5 * 60)->push(new DownloadJob([
    'url' => 'http://example.com/image.jpg',
    'file' => '/tmp/image.jpg',
]));

The exact way a task is executed depends on the used driver. Most drivers can be run using console commands, which the component automatically registers in your application., (*13)

This command obtains and executes tasks in a loop until the queue is empty:, (*14)

yii queue/run

This command launches a daemon which infinitely queries the queue:, (*15)

yii queue/listen

See the documentation for more details about driver specific console commands and their options., (*16)

The component also has the ability to track the status of a job which was pushed into queue., (*17)

// Push a job into the queue and get a message ID.
$id = Yii::$app->queue->push(new SomeJob());

// Check whether the job is waiting for execution.
Yii::$app->queue->isWaiting($id);

// Check whether a worker got the job from the queue and executes it.
Yii::$app->queue->isReserved($id);

// Check whether a worker has executed the job.
Yii::$app->queue->isDone($id);

For more details see the guide., (*18)

The Versions

17/04 2018

dev-master

9999999-dev

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis gii yii queue beanstalk async db gearman

26/12 2017

2.0.2

2.0.2.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis gii yii queue beanstalk async db gearman

13/11 2017

2.0.1

2.0.1.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis gii yii queue beanstalk async db gearman

16/10 2017

dev-enh87

dev-enh87

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis gii yii queue beanstalk async db gearman

15/07 2017

2.0.0

2.0.0.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis gii yii queue beanstalk async db gearman

12/07 2017

1.1.0

1.1.0.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis gii yii queue beanstalk async db gearman

07/06 2017

1.0.1

1.0.1.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis gii yii queue beanstalk async db gearman

03/05 2017

1.0.0

1.0.0.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis gii yii queue beanstalk async db gearman

29/04 2017

0.12.2

0.12.2.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis yii queue beanstalk async db gearman

20/04 2017

0.12.1

0.12.1.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis yii queue beanstalk async db gearman

10/04 2017

0.12.0

0.12.0.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis yii queue beanstalk async db gearman

02/04 2017

0.11.0

0.11.0.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis yii queue beanstalk async db gearman

29/03 2017

0.10.1

0.10.1.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis yii queue beanstalk async db gearman

22/03 2017

0.10.0

0.10.0.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis yii queue beanstalk async db gearman

06/03 2017

0.9.1

0.9.1.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis yii queue beanstalk async db gearman

06/03 2017

0.9.0

0.9.0.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis yii queue beanstalk async db gearman

08/02 2017

0.8.0

0.8.0.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis yii queue async db gearman

05/02 2017

0.7.1

0.7.1.0

Yii2 Queue Extension which supported DB, Redis, RabbitMQ and Gearman

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis yii queue async db gearman

18/12 2016

0.7.0

0.7.0.0

Yii2 Queue Extension

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

rabbitmq redis yii queue async db amqp gearman

12/12 2016

0.6.0

0.6.0.0

Yii2 Queue Extension

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

yii queue async

09/12 2016

0.5.0

0.5.0.0

Yii2 Queue Extension

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

yii queue async

09/12 2016

0.4.1

0.4.1.0

Yii2 Queue Extension

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

yii queue async

08/12 2016

0.4.0

0.4.0.0

Yii2 Queue Extension

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

yii queue async

30/11 2016

0.3.1

0.3.1.0

Yii2 Queue Extension

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

yii queue async

28/11 2016

0.3.0

0.3.0.0

Yii2 Queue Extension

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

yii queue async

18/11 2016

0.2.2

0.2.2.0

Yii2 Queue Extension

  Sources   Download

BSD-3-Clause

The Requires

 

by Roman Zhuravlev

yii queue async

18/11 2016

0.2.1

0.2.1.0

Yii2 Queue Extension

  Sources   Download

BSD-3-Clause

The Requires

 

by Roman Zhuravlev

yii queue async

18/11 2016

0.2.0

0.2.0.0

Yii2 Queue Extension

  Sources   Download

BSD-3-Clause

The Requires

 

by Roman Zhuravlev

yii queue async

01/11 2016

0.1.0

0.1.0.0

Yii2 Queue Extension

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Roman Zhuravlev

yii queue async