PHP code example of flipboxdigital / queue

1. Go to this page and download the library: Download flipboxdigital/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/ */

    

flipboxdigital / queue example snippets

 
yii\base\Event::on(
    flipbox\queue\queues\MultipleByEvent::class,
    flipbox\queue\queues\MultipleByEvent::EVENT_REGISTER_QUEUES,
    function(flipbox\queue\events\RegisterQueues $event) {
        $event->queues[] = [
            'class' => flipbox\queue\queues\Sqs::class,
            'url' => 'https://sqs.us-west-2.amazonaws.com/1234567890/xxxxxx',
            'config' => [
                'region' => 'us-west-2',
                'version' => 'latest'
            ]
        ];
    }
);


$job = new Your\Test\Job();

Queue::getInstance()->getQueue()->post($job);

$job = Queue::getInstance()->getQueue()->fetch();

if ($job) {
    Queue::getInstance()->getQueue()->run($job);
}