This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

PHP Client for Disque

dev-master 2015-05-02 20:27 UTC

This package is auto-updated.

Last update: 2021-06-14 01:20:09 UTC


Build status

The current project is a PHP client for disque. As specified in the project page disque is ongoing experiment to build a distributed, in memory, message broker. Its goal is to capture the essence of the "Redis as a jobs queue" use case.

WARNING: Like disque this project alpha code NOT suitable for production. The implementation and API will likely change in significant ways during the next months. The code and algorithms are not tested enough. A lot more work is needed.

Installing via Composer

The recommended way to install disque client is through Composer.

# Install Composer
curl -sS | php

Next, run the Composer command to install the latest version of Disque Client:

composer.phar require mavimo/disque-client

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';


This is a simple code snippet on how to use the Disque Client:

require 'vendor/autoload.php';

$socket = new Mavimo\Disque\Client\Socket('', 7711);
$client = new Mavimo\Disque\Client\Client($socket);

$queue = new Mavimo\Disque\Queue\Queue('mytest');

$body = json_encode([
    'foo' => true,
    'bar' => 'Lorem ipsum',

$jobA = new Mavimo\Disque\Job\Job($body);
$jobB = new Mavimo\Disque\Job\Job($body);
$jobC = new Mavimo\Disque\Job\Job($body);

$client->push($queue, $jobA);
$client->push($queue, $jobB);
$client->push($queue, $jobC);

$job1 = $client->fetch($queue);
$job2 = $client->fetch($queue);
$job3 = $client->fetch($queue, 1);
$job4 = $client->fetch($queue, 1);