PHPackages                             ericliu000/c-lion-bus - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. ericliu000/c-lion-bus

ActiveLibrary[Queues &amp; Workers](/categories/queues)

ericliu000/c-lion-bus
=====================

lion-bus for composer

1912PHP

Since Jul 3Pushed 7y ago3 watchersCompare

[ Source](https://github.com/ericliu000/c-lion-bus)[ Packagist](https://packagist.org/packages/ericliu000/c-lion-bus)[ RSS](/packages/ericliu000-c-lion-bus/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Lion - Speed &amp; Strength
---------------------------

[](#lion---speed--strength)

Lion belongs to Message Buses(Based On Swoole).

In lion,You don't need to care about the message media(redis,kafka,etc...)

The only thing you need to do is to send message and handle the message!

So simple and useful,just for you!

---

Lion是消息总线的一种实现(基于Swoole实现)。

使用Lion，你不必关心消息的具体存储介质（redis，kafka等等）

你唯一需要做的事情就是发消息和处理消息。

就是这么简单、实用，为你而来！

[![Lion](https://camo.githubusercontent.com/4941a017aaa6cbb4ddcc6346cf0c0da732a7fa3cf9a7d5ac64085a996e95849c/687474703a2f2f7777312e73696e61696d672e636e2f6c617267652f303036306c6d37546c7931666d7767646f646a77766a333068733062663735692e6a7067)](https://camo.githubusercontent.com/4941a017aaa6cbb4ddcc6346cf0c0da732a7fa3cf9a7d5ac64085a996e95849c/687474703a2f2f7777312e73696e61696d672e636e2f6c617267652f303036306c6d37546c7931666d7767646f646a77766a333068733062663735692e6a7067)

---

C-Lion-Bus使用教程
==============

[](#c-lion-bus使用教程)

以下教程，默认你已经安装了swoole。

---

0、c-lion-bus使用说明
----------------

[](#0c-lion-bus使用说明)

c-lion-bus目前版本为v0.1，以composer包的方式提供服务。

c-lion-bus提供了消息总线的功能-即是一个抽象的消息队列。

基于swoole的tcp长连接功能，从此告别while(true)的写法。

c-lion-bus基于可靠消息队列，提供了生产者、消费者的使用，以及简单的消息统计功能。

1、引入c-lion-bus
--------------

[](#1引入c-lion-bus)

- 执行如下命令，引入c-lion-bus

```
composer require ericliu000/c-lion-bus dev-master --prefer-dist

```

2、建立c-lion配置文件
--------------

[](#2建立c-lion配置文件)

建立文件

```
/vendor/config/LionConfig.php

```

示例配置文件，参考

```
/vendor/ericliu000/c-lion-bus/src/Common/LionConfig.php.example

```

3、producer的使用方法
---------------

[](#3producer的使用方法)

```
//$topic为该消息的topic。
//$data为向该topic推送的数据。

use Lion\LionProducer;
$lion = new LionProducer();
$lion->produce($topic,$data);

```

示例

```
use Lion\LionProducer;
$lion = new LionProducer();
$lion->produce('SignTopic',['sign'=>1,'check'=>true]);

```

4、comsumer的使用方法
---------------

[](#4comsumer的使用方法)

```
1、在LionConfig.php中，配置consumer获取到该topic数据后要执行的命令
2、启动consumer

```

示例

```
1、示例为：在LionConfig.php中，配置topic=Sign 与 topic=Sms的command
'command'=>[
        'Sign'=>'cd /Users/ericliu000/Project/maibei-backend && php -f /Users/ericliu000/Project/maibei-backend/console.php /Index/Sign',
        'Sms'=>'cd /Users/ericliu000/Project/maibei-backend && php -f /Users/ericliu000/Project/maibei-backend/console.php /Index/Sms',
    ]

2、启动Topic=Sms的消费进程
TOPIC=Sms php vendor/ericliu000/c-lion-bus/bin/consume.php &

3、启动Topic=Sign的消费进程
TOPIC=Sign php vendor/ericliu000/c-lion-bus/bin/consume.php &

```

实际消费方法如下

```
//1、IndexController.class.php定义方法如下

public function Sign(){
        //$argv是一个数组，包含上面的数据即['sign'=>1,'check'=>true]
        global $argv;

        //Do Your Logic...
}

public function Sms(){
        //$argv是一个数组，包含上面的生产者生产的数据
        global $argv;

        //Do Your Logic...
}

```

有使用疑问请联系 E-MAIL:

TODO
----

[](#todo)

1、接入kafka

2、接入rabbitmq

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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://avatars.githubusercontent.com/u/194058874?v=4)[ericliu000](/maintainers/ericliu000)[@ericliu000](https://github.com/ericliu000)

---

Top Contributors

[![xxdf2](https://avatars.githubusercontent.com/u/16330467?v=4)](https://github.com/xxdf2 "xxdf2 (5 commits)")

### Embed Badge

![Health badge](/badges/ericliu000-c-lion-bus/health.svg)

```
[![Health](https://phpackages.com/badges/ericliu000-c-lion-bus/health.svg)](https://phpackages.com/packages/ericliu000-c-lion-bus)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.5M30](/packages/league-geotools)[illuminate/bus

The Illuminate Bus package.

6045.5M508](/packages/illuminate-bus)[uecode/qpush-bundle

Asynchronous processing for Symfony using Push Queues

1672.5M2](/packages/uecode-qpush-bundle)[jayazhao/think-queue-rabbitmq

为 ThinkPHP5.1 队列增加 RabbitMQ 驱动

141.5k](/packages/jayazhao-think-queue-rabbitmq)[mayconbordin/l5-stomp-queue

Stomp Queue Driver for Laravel 5

121.1k](/packages/mayconbordin-l5-stomp-queue)

PHPackages © 2026

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