2017 © Pedro Peláez
 

yii2-extension yii2-resque

Queue component for Yii2.

image

igoryan-909/yii2-resque

Queue component for Yii2.

  • Wednesday, April 5, 2017
  • by igoryan-909
  • Repository
  • 1 Watchers
  • 1 Stars
  • 191 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Redis queue for Yii2

Simplified php-resque component for Yii2., (*1)

Installation

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

Either run, (*3)

php composer.phar require --prefer-dist igoryan-909/yii2-resque "*"

or add, (*4)

"igoryan-909/yii2-resque": "*"

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

Usage

Set config :, (*6)

'controllerMap' => [
    'resque' => [
        'class' => 'ivanoff\resque\controllers\ResqueController',
    ],
],

Start daemon :, (*7)

php yii resque/listen queue_name, (*8)

Add job class :, (*9)

class MyJob extends Job
{
    public function setUp()
    {
        # Set up environment for this job
    }

    public function perform()
    {
        # The arguments which given in resque enqueue method are available in $this->args
    }

    public function tearDown()
    {
        # Remove environment for this job
    }
}

For adding job :, (*10)

$resque = new Resque([
    'redis' => new Connection([
        'hostname' => 'xxx.xxx.xxx.xxx',
    ]),
]);

$token = $resque->enqueue('queue_name', Job::className(), ['arg' => 'val'], true);

For check job status :, (*11)

$status = (new JobStatus([
    'redis' => new Connection([
       'hostname' => 'xxx.xxx.xxx.xxx',
    ]),
    'id' => $token
]))->get();

or get the status from the resque object with its redis :, (*12)

$resque->status($token)->get()

The Versions

05/04 2017

dev-master

9999999-dev

Queue component for Yii2.

  Sources   Download

MIT

The Requires

 

by Igor Ivanoff

extension yii2 queue