PHPackages                             sevenlinx/pubsub-redis-php - 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. [Caching](/categories/caching)
4. /
5. sevenlinx/pubsub-redis-php

ActiveLibrary[Caching](/categories/caching)

sevenlinx/pubsub-redis-php
==========================

Redis driver in PubSub

03PHP

Since Apr 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/seven-linx-incorporated/pubsub-redis-php)[ Packagist](https://packagist.org/packages/sevenlinx/pubsub-redis-php)[ RSS](/packages/sevenlinx-pubsub-redis-php/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

PubSub Redis Driver (PHP)
=========================

[](#pubsub-redis-driver-php)

---

Requirements
------------

[](#requirements)

- PHP `^8.0`
- [ext-phpredis](https://github.com/phpredis/phpredis) - For Redis extension and `PhpRedisConnector` (**RECOMMENDED**)
- [predis/predis](https://github.com/predis/predis) - For `PredisConnector`

---

Installation
------------

[](#installation)

There are two (2) types for Redis client, that needs to install, see [Requirements](#requirements)

- [ext-phpredis](https://github.com/phpredis/phpredis) - PHP Extension for Redis, need to build PHP
- [predis/predis](https://github.com/predis/predis) - Pure PHP client for Redis

As soon you have any of the client, you may:

```
composer require sevenlinx/pubsub-redis-php
```

---

Implement your own Redis connector
----------------------------------

[](#implement-your-own-redis-connector)

You may implement your own Redis client decorator, by implementing `\SevenLinX\PubSub\Redis\Contracts\ConnectorContract`

```
use SevenLinX\PubSub\Redis\Contracts\ConnectorContract;

class MyOwnConnector implements ConectorContract
{
    ...
    public function publish(ChannelContract $channel, MessageContract $message): int
    {
        return $this->client->publish($channel->name(), $message->payload());
    }

    public function subscribe(ChannelContract|array $channels, Closure $handler): void
    {
        $this->client->subscribe($channels->name(), [$handler, 'handle']);
    }
}

// subscribe.php
$driver = new RedisDriver(new MyOwnConnector());
$driver->subscribe(new GenericChannel(), function(GenericPayload $payload, redis) {
    var_dump($payload);
});
```

---

Example
-------

[](#example)

You can check on `examples/` directory

**/!\\ NOTE: This requires an existing redis server /!\\**

---

Testing
-------

[](#testing)

```
composer run testing
```

---

###### Created under [Seven LinX Incorporated](https://sevenlinx.tech)

[](#created-under-seven-linx-incorporated)

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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/ccb2da23632346595380271ccb477d6f054912dde484fb463818d2d5b5b0ae19?d=identicon)[jayaregalinada](/maintainers/jayaregalinada)

---

Top Contributors

[![jayaregalinada](https://avatars.githubusercontent.com/u/1170288?v=4)](https://github.com/jayaregalinada "jayaregalinada (8 commits)")

### Embed Badge

![Health badge](/badges/sevenlinx-pubsub-redis-php/health.svg)

```
[![Health](https://phpackages.com/badges/sevenlinx-pubsub-redis-php/health.svg)](https://phpackages.com/packages/sevenlinx-pubsub-redis-php)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

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