PHPackages                             hollisho/yii2-redis-pub-sub - 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. hollisho/yii2-redis-pub-sub

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

hollisho/yii2-redis-pub-sub
===========================

Yii2 Redis pub/sub(Publish,Subscribe)

0.1.0(7y ago)12641MITPHPPHP &gt;=5.4.0

Since Nov 22Pushed 7y ago1 watchersCompare

[ Source](https://github.com/hollisho/yii2-redis-pub-sub)[ Packagist](https://packagist.org/packages/hollisho/yii2-redis-pub-sub)[ RSS](/packages/hollisho-yii2-redis-pub-sub/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

yii2-redis-pub-sub
==================

[](#yii2-redis-pub-sub)

基于yii2通过redis的订阅／发布者模式实现的消息队列

install
=======

[](#install)

- 安装phpredis扩展
- 安装代码

```
composer require --prefer-dist hollisho/yii2-redis-pub-sub
```

usage
=====

[](#usage)

- 配置文件

```
'redisPubSub'=>[
    'class' => 'hollisho\redis_pub_sub\RedisPubSub',
    'connect' => [
        'class' => 'yii\redis\Connection',
        'hostname' => '127.0.0.1',
        'port' => 6379,
        'database' => 0,
        'password' => '',
        'connectionTimeout' => 20,
    ]
],
```

- 使用

```
//　前台发送
/* @var $redisPubSub RedisPubSub */
$redisPubSub = \Yii::$app->redisPubSub;
$redisPubSub->publish('test', 'xxxxxxxxxxxxxxx');

// console里面监听，并且处理，设置监听不超时
/* @var $redisPubSub RedisPubSub */
$redisPubSub = \Yii::$app->redisPubSub;
$redisPubSub->setOptReadTimeout(-1);
$redisPubSub->subscribe('test', function($instance, $channelName, $message) {
    var_dump($message);
});
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2731d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e8e63d951619620f1fabe34874623212834045e7ce9b77da8e47769c6e3d7a4?d=identicon)[hollisho](/maintainers/hollisho)

---

Top Contributors

[![hollisho](https://avatars.githubusercontent.com/u/13307208?v=4)](https://github.com/hollisho "hollisho (1 commits)")

### Embed Badge

![Health badge](/badges/hollisho-yii2-redis-pub-sub/health.svg)

```
[![Health](https://phpackages.com/badges/hollisho-yii2-redis-pub-sub/health.svg)](https://phpackages.com/packages/hollisho-yii2-redis-pub-sub)
```

###  Alternatives

[pragmarx/support

PragmaRX components support package

591.5M27](/packages/pragmarx-support)[bcremer/line-reader

Read large files line by line in a memory efficient (constant) way.

301.6M4](/packages/bcremer-line-reader)[beelab/recaptcha2-bundle

Provide Google Recaptcha2 form type

55455.1k1](/packages/beelab-recaptcha2-bundle)[lkrms/pretty-php

The opinionated PHP code formatter

14659.1k1](/packages/lkrms-pretty-php)[kreyu/data-table-bundle

Streamlines creation process of the data tables

11299.6k](/packages/kreyu-data-table-bundle)[adhocore/cron-expr

Ultra lightweight Cron Expression parser for PHP

53436.1k3](/packages/adhocore-cron-expr)

PHPackages © 2026

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