Skip to content

Latest commit

 

History

History
118 lines (88 loc) · 3.59 KB

README.md

File metadata and controls

118 lines (88 loc) · 3.59 KB

disque-php

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

A PHP library for the very promising disque distributed job queue. Features:

  • Support for both PHP (5.5+) and HHVM
  • No dependencies: Fast connection to Disque out-of-the-box
  • Support for multi-node connection
  • Connect to Disque with the built-in connection, or reutilize your existing Redis client (such as predis)
  • Supporting all current Disque commands, and allows you to easily implement support for custom commands
  • Fully unit tested

Installation

$ composer require mariano/disque-php --no-dev

If you want to run its tests remove the --no-dev argument.

Usage

Connect:

$client = \Disque\Client([
    '127.0.0.1:7111',
    '127.0.0.2:7112'
]);
try {
    $client->connect();
} catch (\Disque\Exception\ConnectionException $e) {
    die($e->getMessage());
}

Queue jobs:

$payload = ['name' => 'Mariano'];
$client->addJob('queue', json_encode($payload));

Get jobs from queue:

$job = $client->getJob('queue');
$payload = json_decode($job, true);
var_dump($payload);

For a full coverage of the API, read the full documentation.

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Support

I must reiterate this is a definite work in progress, so expect your coffee machine to blow up when using disque-php. If you need some help or even better want to collaborate, feel free to hit me on twitter: @mgiglesias

Security

If you discover any security related issues, please contact @mgiglesias instead of using the issue tracker.

TODO

  • HELLO
  • INFO
  • SHOW
  • ADDJOB
  • DELJOB
  • GETJOB
  • ACKJOB
  • FASTACK
  • ENQUEUE
  • DEQUEUE
  • QLEN
  • QPEEK
  • QSTAT, SCAN when they are implemented upstream
  • Add support for several connections
  • Allow GETJOB to influence what node the Client should be connected to
  • Implement direct protocol to Disque to avoid depending on Predis
  • Turn Predis integration into a ConnectionInterface
  • Allow user to specify their own ConnectionInterface implementation
  • Add support for PSR Logging

Acknowledgments

First and foremost, Salvatore Sanfilippo for writing what looks to be the definite solution for job queues (thanks for all the fish Gearman).

Other disque client libraries for the inspiration.

The PHP League for an awesome README.md skeleton, and tips about packaging PHP components.

License

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