2017 © Pedro Peláez
 

silverstripe-module silverstripe-queue

Simple multi driver queue system.

image

studiobonito/silverstripe-queue

Simple multi driver queue system.

  • Friday, June 6, 2014
  • by nedmas
  • Repository
  • 4 Watchers
  • 7 Stars
  • 119 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 3 Open issues
  • 11 Versions
  • 1 % Grown

The README.md

Queue Module

Build Status Scrutinizer Code Quality Code Coverage, (*1)

Overview

Simple multi driver queue system. This is essentially a port of the Laravel queue system., (*2)

Still very much a WIP not for use in production!, (*3)

Although it would be better to use illuminate/queue directly it has too many dependancies that would replicate silverstripe/framework functionality at this time. By porting the code we can take advantage of SilverStripes command line framework and dependancy injection whilst still having a feature rich and multi backend queue system., (*4)

So our thanks go to Taylor Otwell et al for their excellent work on Laravel., (*5)

Requirements

  • SilverStripe 3.1 or newer.
  • pda/pheanstalk 2.1 or newer for Beanstalkd support

Supported Backends

  • [x] Synchronous
  • [x] SilverStripe Database
  • [x] Beanstalkd
  • [ ] IronMQ
  • [ ] Amazon SQS
  • [ ] Redis

Installation Instructions

Composer

Run the following to add this module as a requirement and install it via composer., (*6)

$ composer require studiobonito/silverstripe-queue

Manual

Copy the 'queue' folder to your the root of your SilverStripe installation., (*7)

Configuration Overview

Configure the queue drivers with the following YAML., (*8)

StudioBonito\SilverStripe\Queue\QueueManager:
    default: 'db'
    db:
        driver: 'db'
        queue: 'default'
    beanstalkd:
        driver: 'beanstalkd'
        host: 'localhost'
        queue: 'default'
        ttr: 60

Usage Overview

Import QueueManager

Import the QueueManager class for ease of use., (*9)

use StudioBonito\SilverStripe\Queue\QueueManager;

Push A Job Onto The Queue

Use QueueManager::inst() to get an instance of the QueueManger class and then call the push() method passing in the name of a job handler and an array of data., (*10)

QueueManager::inst()->push('SendEmail', array('message' => $message));

Creating A Job Handler

Job handlers are simple classes that contain a run method with $job and $data parameters., (*11)

class SendEmail {

    public function run($job, $data)
    {
        // Code for processing job goes here.
    }
}

Contributing

Unit Testing

$ composer install --prefer-dist --dev
$ phpunit

License

All original work copyright of Taylor Otwell under MIT license. All subsequent work copyright Studio Bonito Ltd. under BSD-2-Clause license., (*12)

The Versions

06/06 2014

dev-master

9999999-dev

Simple multi driver queue system.

  Sources   Download

BSD-2-Clause

The Development Requires

queue silverstripe beanstalk

06/06 2014

0.8.2

0.8.2.0

Simple multi driver queue system.

  Sources   Download

BSD-2-Clause

The Development Requires

queue silverstripe beanstalk

06/06 2014

dev-develop

dev-develop

Simple multi driver queue system.

  Sources   Download

BSD-2-Clause

The Development Requires

queue silverstripe beanstalk

05/06 2014

0.8.1

0.8.1.0

Simple multi driver queue system.

  Sources   Download

BSD-2-Clause

The Development Requires

queue silverstripe beanstalk

05/06 2014

0.8.0

0.8.0.0

Simple multi driver queue system.

  Sources   Download

BSD-2-Clause

The Development Requires

queue silverstripe beanstalk

20/05 2014

0.7.0

0.7.0.0

Simple multi driver queue system.

  Sources   Download

BSD-2-Clause

The Development Requires

queue silverstripe beanstalk

20/05 2014

0.6.0

0.6.0.0

Simple multi driver queue system.

  Sources   Download

BSD-2-Clause

The Development Requires

queue silverstripe beanstalk

20/05 2014

0.5.0

0.5.0.0

Simple multi driver queue system.

  Sources   Download

BSD-2-Clause

The Development Requires

queue silverstripe beanstalk

16/05 2014

0.4.0

0.4.0.0

Simple multi driver queue system.

  Sources   Download

BSD-2-Clause

The Development Requires

queue silverstripe beanstalk

14/05 2014

0.3.0

0.3.0.0

Simple multi driver queue system.

  Sources   Download

BSD-2-Clause

The Development Requires

queue silverstripe beanstalk

14/05 2014

0.2.0

0.2.0.0

Simple multi driver queue system.

  Sources   Download

BSD-2-Clause

The Development Requires

queue silverstripe beanstalk