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

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

uniondrug/mq
============

A mini MQ based on phalcon

1.2(8y ago)029MITPHPPHP &gt;=7.0

Since Feb 6Pushed 8y ago2 watchersCompare

[ Source](https://github.com/uniondrug/mq)[ Packagist](https://packagist.org/packages/uniondrug/mq)[ RSS](/packages/uniondrug-mq/feed)WikiDiscussions master Synced today

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

mq
==

[](#mq)

> MQ( `Message Queue` ), 即消息队列；模块/服务/业务之间异常通信的中间件。

```
class ExampleController ...
{
    public function indexAction()
    {
        $order = OrderStruct::init(...);
        $mq = new Mq();
        $mq->order->afterAudit($order);
    }
}
```

### Producter

[](#producter)

- **OrderMq**
    - `afterAudit`(`$data`) - 订单审核完成之后
    - `afterAuditFailure`(`$data`) - 订单审核失败之后
    - `afterCreated`(`$data`) - 订单创建完成之后
    - `afterCancelled`(`$data`) - 订单被取消之后
    - `afterCompleted`(`$data`) - 订单支付完成之后
- **PromotionMq**
    - `afterConsumed`(`$data`) - 优惠券完成消费之后
    - `afterCreated`(`$data`) - 优惠券创建之后
    - `afterLocked`(`$data`) - 优惠券锁定之后
    - `afterUnlock`(`$data`) - 优惠券解锁之后
- **RightsMq**
    - `afterActived`(`$data`) - 权益激活之后
    - `afterConsumed`(`$data`) - 权益消费完成之后
    - `afterCreated`(`$data`) - 权益创建完成之后
    - `afterLocked`(`$data`) - 权益被锁定之后
    - `afterUnlock`(`$data`) - 权益解除锁定之后

### Consumer

[](#consumer)

> MQ消费方, 使用`getPayloadBody()`方法获取数据，获取到的数据有以下二种可能的来源

1. 自MQ服务器转过的异步POST请求。
2. 来自RestfulAPI的Request请求。

```
class ExampleController ...
{
    public function testAction()
    {
        // 提取数据, 以下二种来源
        // 1. 来自MQ
        // 2. API请求
        $payload = $this->getPayloadBody();

        // 打印结果如下:
        // {
        //     "key" => "value"
        // }
        print_r (json_encode($payload, true));
    }
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

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 ~0 days

Total

2

Last Release

3017d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/865ceb7d8226574735eab8fc82de9cfbc4a708c291b3c816e75d53944348b686?d=identicon)[wsfuyibing](/maintainers/wsfuyibing)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[amphp/parser

A generator parser to make streaming parsers simple.

14952.8M16](/packages/amphp-parser)[amphp/serialization

Serialization tools for IPC and data storage in PHP.

13451.1M18](/packages/amphp-serialization)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[deliciousbrains/wp-background-processing

WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.

1.1k409.8k6](/packages/deliciousbrains-wp-background-processing)[react/async

Async utilities and fibers for ReactPHP

2238.8M171](/packages/react-async)

PHPackages © 2026

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