PHPackages                             iris/nsq\_to\_swoole - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. iris/nsq\_to\_swoole

ActiveLibrary[HTTP &amp; Networking](/categories/http)

iris/nsq\_to\_swoole
====================

a strong php client for NSQ using swoole extension

1.2.2(8y ago)354.8k4[4 issues](https://github.com/iris-xie/nsq_to_swoole/issues)MITPHPPHP &gt;=5.5

Since Oct 19Pushed 6y ago4 watchersCompare

[ Source](https://github.com/iris-xie/nsq_to_swoole)[ Packagist](https://packagist.org/packages/iris/nsq_to_swoole)[ Docs](https://github.com/iris-xie)[ RSS](/packages/iris-nsq-to-swoole/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

nsq\_to\_swoole
===============

[](#nsq_to_swoole)

a strong php client for NSQ using swoole extension

### 必要组件

[](#必要组件)

- PHP &gt;= 5.5
- Swoole &gt;= 1.8.6

### 安装

[](#安装)

```
pecl install swoole

composer require iris/nsq_to_swoole

```

### 发布

[](#发布)

客户端支持NSQ服务器集群,同时支持单次多条消息发送

```
$hosts = [
    ['host' => '192.168.9.135', 'port' => 4150],
];

$client = new Iris\NsqToSwoole\Client;
$client->setTarget($hosts, 1);

$client->pub('examples', 'Hello From iris-xie', 1);
```

### 订阅

[](#订阅)

首先通过lookup获取列表,然后才可以订阅

```
$lookup = new Iris\NsqToSwoole\Lookup\Lookupd([
    ['host' => '192.168.9.135', 'port' => 4161],
]);

$client = new Iris\NsqToSwoole\Client;

$client->sub($lookup, 'examples', 'example', function($moniter, $msg) {
    echo sprintf("READ\t%s\t%s\n", $msg->getId(), $msg->getPayload());
});
```

### 使用示例

[](#使用示例)

```
cd nsq_to_swoole/examples

```

Pub:

```
php Pub.php

```

Sub:

```
php Sub.php

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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

3101d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3533890326ce48a04c787e0e548ad368f43a60b03388f1e2a67290a07afca9d2?d=identicon)[iris-xie](/maintainers/iris-xie)

---

Top Contributors

[![iris-xie](https://avatars.githubusercontent.com/u/14687244?v=4)](https://github.com/iris-xie "iris-xie (1 commits)")[![marlonfan](https://avatars.githubusercontent.com/u/9349370?v=4)](https://github.com/marlonfan "marlonfan (1 commits)")

---

Tags

phpclientSocketswoolensq

### Embed Badge

![Health badge](/badges/iris-nsq-to-swoole/health.svg)

```
[![Health](https://phpackages.com/badges/iris-nsq-to-swoole/health.svg)](https://phpackages.com/packages/iris-nsq-to-swoole)
```

###  Alternatives

[swlib/saber

Swoole coroutine HTTP client

985145.0k27](/packages/swlib-saber)[simps/mqtt

MQTT Protocol Analysis and Coroutine Client for PHP

39351.6k9](/packages/simps-mqtt)[swoole/grpc

Grpc PHP Client base on Swoole Http2 Coroutine

19718.9k1](/packages/swoole-grpc)[swoole/etcd-client

Grpc PHP Client base on Swoole Http2 Coroutine

1973.2k1](/packages/swoole-etcd-client)[swoft/http-client

HTTP Client Component for Swoft

1139.3k4](/packages/swoft-http-client)[warriorxk/phpwebsockets

A websocket library with support for IPC using socket pairs

1225.3k](/packages/warriorxk-phpwebsockets)

PHPackages © 2026

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