PHP code example of macklus / yii2-simple-queue

1. Go to this page and download the library: Download macklus/yii2-simple-queue library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

macklus / yii2-simple-queue example snippets


Yii::$app->queue->putInTube($queue, [array_of_vars_of_job]);



namespace app\commands;

use macklus\SimpleQueue\SimpleQueueController;

class SqController extends SimpleQueueController
{

    const DELAY_PRIORITY = 1000; //Default priority
    const DELAY_TIME = 60; //Default delay time
    const DELAY_MAX = 3;

    public function listenTubes()
    {
        return ['test'];
    }

    public function actionTest($job)
    {
        $jobData = $job->getData();
        // do some stuff
        return self::DELETE;
    }
}

php composer.phar