PHPackages                             varspool/predisque - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. varspool/predisque

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

varspool/predisque
==================

Disque client based on Predis

05PHP

Since May 6Pushed 9y agoCompare

[ Source](https://github.com/dominics/predisque)[ Packagist](https://packagist.org/packages/varspool/predisque)[ RSS](/packages/varspool-predisque/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

Predisque
=========

[](#predisque)

[![Build Status](https://camo.githubusercontent.com/d97815963223ff709aafc571582e62f2b4aeafdd27c91230cc00fbf9dd08d3fd/68747470733a2f2f7472617669732d63692e6f72672f646f6d696e6963732f7072656469737175652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dominics/predisque)

A [Disque](https://github.com/antirez/disque) client for PHP 7.1+ based on (and depending on) Predis. `predis : redis :: predisque : disque`, yeah?

The library is made up of:

- A set of commands (as in `Predis\Command\Command`) that you can use with Disque, and a server profile for Predis
- A `Predisque\Client` that's set up to use port 7711 and the Disque server profile by default
- An aggregate connection (`Predisque\Connection\Aggregate\DisqueCluster`) that handles talking to a Disque cluster as a whole
    - Supports discovery via `HELLO`
    - Supports retrying commands transparently if they fail with a `ConnectionException` (so we handle `-LEAVING` responses by swapping to another node)

Because Predisque is based on a feature-rich Predis core, we get things like pipelining and nice underlying Redis protocol support "for free". (A Disque client library should probably not contain its own native Redis protocol parser.)

Support for all Disque commands is implemented, including exotic ones like `DEBUG`, `MONITOR`, and `CLUSTER INFO`. See [TODO.md](TODO.md) for progress on reaching a stable API.

Not yet stable for production use.

Usage
-----

[](#usage)

The PHP namespace is `\Predisque`

To create a client, instantiate a `new \Predisque\Client(string|array $parameters = [], array $options = [])`.

The method signature is similar to a Predis client: the connection parameters (host, port, etc.) come first, and can be given in array or DSN/URI string notation. Then a set of more general options comes after. So, all of the following have the same result (a connection to a single Disque server):

```
$client = new \Predisque\Client();
$client = new \Predisque\Client('tcp://127.0.0.1:7711');
$client = new \Predisque\Client([
    'host' => '127.0.0.1',
    'port' => 7711
]);
```

Connecting to multiple servers is as easy as passing an array of node details:

```
$client = new \Predisque\Client(['tcp://127.0.0.1:7711', 'tcp://127.0.0.1:7712', 'tcp://127.0.0.1:7713']);
```

### Connection Switching

[](#connection-switching)

Only one of these connections will be utilized at a time, but the others will be used if the connection to the first server fails, or if it gives a `-LEAVING` response. Also, details from the cluster's `HELLO` response will be used to connect to even further backup nodes (so make sure all nodes are accessible to every client).

You can control this behavior with the `discover` option:

```
$client = new \Predisque\Client('tcp://127.0.0.1:7711', ['discover' => false]);
```

You can also *disable* all Disque-specific connection niceties (and the aggregate connection in general), by passing the `'cluster' => false` option:

```
$client = new \Predisque\Client('tcp://127.0.0.1:7711', ['cluster' => false]);
```

Testing
-------

[](#testing)

**Warning: the test suite uses the `DEBUG FLUSHALL` command. Do not run the tests against a Disque instance you care about.** Running the tests will destroy all data on the disque instance they use. (You won't have the tests if you're just using the client as a dist from composer.)

To execute the test suite, run e.g. `DISQUE_SERVER_PORT=7711 ./vendor/bin/phpunit` - the port must be specified, or the unhelpful default of 12345 will be used to prevent accidents.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7972f8f29b6eda4b2ffa4d6e087a3551b2d909090d2bbcdb212b29a86fed07b?d=identicon)[dominics](/maintainers/dominics)

---

Top Contributors

[![dominics](https://avatars.githubusercontent.com/u/97427?v=4)](https://github.com/dominics "dominics (51 commits)")

---

Tags

disquephppredis

### Embed Badge

![Health badge](/badges/varspool-predisque/health.svg)

```
[![Health](https://phpackages.com/badges/varspool-predisque/health.svg)](https://phpackages.com/packages/varspool-predisque)
```

###  Alternatives

[rezzza/formulate

Making life easier while writing complex math formulas, take a breath

1235.3k1](/packages/rezzza-formulate)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
