PHPackages                             bcw/mq-process - 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. bcw/mq-process

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

bcw/mq-process
==============

bcw-mq-swoole

1.0.1(9y ago)07MITPHPPHP &gt;=5.4

Since Mar 16Pushed 9y ago1 watchersCompare

[ Source](https://github.com/wangzhenyi2011/bcw-mq-process)[ Packagist](https://packagist.org/packages/bcw/mq-process)[ Docs](https://github.com/wangzhenyi2011)[ RSS](/packages/bcw-mq-process/feed)WikiDiscussions master Synced 4w ago

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

Bcw-Swool-process
-----------------

[](#bcw-swool-process)

- 多进程消费

多消费者,并行处理
---------

[](#多消费者并行处理)

- 这可能是最常遇到的一种场景了. 消息产生之后堆到队列里, 有多个消费者的 worker 来共同处理这些消息, 以并行的方式提高处理效率.
- 这种场景在 Exchange 的类似选择上, 不管是 fanout 或者是 direct 都可以实现. 稍有不同在于, fanout 类型的话, 你在一个 exchange 上就不要乱绑定队列. direct 类型的话, 则是需要每条消息自己处理好 routing\_key .

描述
--

[](#描述)

- 最先搞过PHP自带的pcntl，发现对于这块写了虽然能实现，但是效果和稳定性不太理想
- 利用swoole\_process::daemon守护进程
- 利用swoole的异步信号监听，worker进程退出后会自动拉起
- 利用sswoole\_process::wait,回收结束运行的子进程,防止成为僵尸进程
- 子进程过大主动杀死，防止业务代码内存泄漏
- rabbitmq多种的实现（多消费者, 并行处理;一条消息多种处理, 临时队列;发布订阅)
- 支持composer，可以跟任意框架集成

示例
--

[](#示例)

```
composer install

//往队列添加job
php test/testJobs.php

## 性能

* 瓶颈: rabbitmq队列存储本身和job执行速度

```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Every ~25 days

Total

2

Last Release

3368d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4533922?v=4)[wangzhenyi](/maintainers/wangzhenyi)[@wangzhenyi](https://github.com/wangzhenyi)

---

Top Contributors

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

---

Tags

swoolebcw

### Embed Badge

![Health badge](/badges/bcw-mq-process/health.svg)

```
[![Health](https://phpackages.com/badges/bcw-mq-process/health.svg)](https://phpackages.com/packages/bcw-mq-process)
```

PHPackages © 2026

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