2017 © Pedro Peláez
 

library queue

Generic queue

image

queue/queue

Generic queue

  • Thursday, December 31, 2015
  • by NoUseFreak
  • Repository
  • 2 Watchers
  • 3 Stars
  • 1,374 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 5 Open issues
  • 2 Versions
  • 10 % Grown

The README.md

Queue

Build Status Author License, (*1)

This library is a Queueing Aystem abstraction layer. It enables you to implement any queueing system in your application, without having to depend on the actual implementation of the queueing system you choose., (*2)

Attention: You will need a Process Control System like supervisord to keep your workers going., (*3)

Use Case

Queueing system, (*4)

Say you want to notify multiple users when a new comment is placed on a forum thread. Sending these email on the spot might slow down your application significantly when many emails need to be send. When using a Queueing System you can delay this action by adding the Jobs to a Queue. A worker will pick up these Jobs asynchronously from you web process. This way your application is future proof and you will have a much easier time scaling in the future., (*5)

Library, (*6)

When you decide to use this library, you do not depend on the queueing system implementation. You can plug the driver of your choice. You might choose a basic mysql version to get started and when you need more performance go for something like beanstalkd or RabbitMQ., (*7)

Code example

<?php

require_once(__DIR__ . '/vendor/autoload.php');

use Queue\Queue;
use Queue\Job\Job;
use Queue\Executor\JobExecutor;

$driver = new QueueDriver(); // Use your driver.
$queue = new Queue($driver);

// Add a job to the queue
$queue->addJob(new Job('notify_forum_thead', ['threadId' => 12]));
<?php

require_once(__DIR__ . '/vendor/autoload.php');

use Queue\Queue;
use Queue\Worker\Worker;

$driver = new QueueDriver(); // Use your driver.
$queue = new Queue($driver);

$worker = new Worker($queue, new JobExecutor(), 1);
$worker->run();

Installation

Run this command to get the latest version from packagist:, (*8)

$ composer require queue/queue

Contributing

All code contributions - including those of people having commit access - must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code., (*9)

Fork the project, create a feature branch, and send us a pull request., (*10)

To ensure a consistent code base, you should make sure the code follows the Coding Standards which we borrowed from Symfony. Make sure to check out php-cs-fixer as this will help you a lot., (*11)

If you would like to help, take a look at the list of issues., (*12)

Requirements

PHP 5.5 or above, (*13)

Author and contributors

Dries De Peuter - dries@nousefreak.be - http://nousefreak.be, (*14)

See also the list of contributors who participated in this project., (*15)

License

Cron is licensed under the MIT license., (*16)

The Versions

31/12 2015

dev-master

9999999-dev

Generic queue

  Sources   Download

MIT

The Requires

  • php >=5.5
  • psr/log-implementation ^1.0.0

 

The Development Requires

31/12 2015

0.1.0

0.1.0.0

Generic queue

  Sources   Download

MIT

The Requires

  • php >=5.5
  • psr/log-implementation ^1.0.0

 

The Development Requires