There is no license information available for the latest version (1.0.0-beta.3) of this package.

Simple queue

Maintainers

Details

github.com/flipbox/queue

Source

Issues

Installs: 2 419

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Type:craft-plugin

1.0.0-beta.3 2017-08-03 15:33 UTC

This package is auto-updated.

Last update: 2024-12-09 13:33:40 UTC


README

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

This package provides a robust queue system for Craft CMS.

Installation

To install, use composer:

composer require flipboxdigital/queue

In the Craft Control Panel, go to Settings → Plugins and click the "Install" button for Queue.

Usage

By default, multiple queues are supported. In order to add a new queue, register it via an event in your Plugin::init():

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'
            ]
        ];
    }
);

To post a new job (extend flipbox\queue\jobs\AbstractJob)

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

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

To run a job:

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

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

Testing

$ ./vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.