PHPackages                             heimi/swoole-worker - 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. [Framework](/categories/framework)
4. /
5. heimi/swoole-worker

ActiveLibrary[Framework](/categories/framework)

heimi/swoole-worker
===================

SwooleWorker是基于Swoole开发的一款分布式长连接开发框架。常驻内存，协程，高性能高并发；分布式部署，横向扩容，使得能支持庞大的连接数；无感知安全重启，无缝升级代码；接口丰富，支持单个发送，分组发送，群发广播等接口。可广泛应用于云计算、物联网（IOT）、车联网、智能家居、网络游戏等领域。

2.1.3(2y ago)019Apache-2.0PHPPHP &gt;=7.2

Since May 30Pushed 2y agoCompare

[ Source](https://github.com/heimi1985/swoole-worker)[ Packagist](https://packagist.org/packages/heimi/swoole-worker)[ Docs](https://github.com/heimi1985/swoole-worker)[ RSS](/packages/heimi-swoole-worker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

介绍
==

[](#介绍)

SwooleWorker是基于swoole开发的一款分布式长连接开发框架。常驻内存，协程，高性能高并发；分布式部署，横向扩容，使得能支持庞大的连接数；无感知安全重启，无缝升级代码；接口丰富，支持单个发送，分组发送，群发广播等接口。可广泛应用于云计算、物联网（IOT）、车联网、智能家居、网络游戏等领域。

[【官方网站】](http://swoole.plus)[【开发文档】](docs/zh-CN)

[![架构图](https://camo.githubusercontent.com/6eab6fc03d9a8fcf7428798b30a3d7ce7eab7357eb66ef1381bc21a675918364/68747470733a2f2f7374617469632e6562636d732e636f6d2f696d672f73772e706e67)](https://camo.githubusercontent.com/6eab6fc03d9a8fcf7428798b30a3d7ce7eab7357eb66ef1381bc21a675918364/68747470733a2f2f7374617469632e6562636d732e636f6d2f696d672f73772e706e67)

适用对象
----

[](#适用对象)

SwooleWorker是一个长链接框架，适用于需要长期保持连接的服务

适用于：

- 物联网
- 车联网
- 智能家居
- 网络游戏
- 移动推送
- IM

不适用于：

- 传统web项目

安装
--

[](#安装)

```
composer require xielei/swoole-worker
```

接口
--

[](#接口)

接口参数返回值sendToClientstring $client, string $messagesendToUidstring $uid, string $message, array $without\_client\_list = \[\]sendToGroupstring $group, string $message, array $without\_client\_list = \[\]sendToAllstring $message, array $without\_client\_list = \[\]isOnlinestring $clientisUidOnlinestring $uidboolgetClientListByGroupstring $group, string $prev\_client = nulliterablegetClientCountintgetClientCountByGroupstring $groupintgetClientListstring $prev\_client = nulliterablegetClientListByUidstring $uid, string $prev\_client = nulliterablegetClientInfostring $client, int $type = 255arraygetUidListByGroupstring $group, bool $unique = trueiterablegetUidListbool $unique = trueiterablegetUidCountfloat $unique\_percent = nullintgetGroupListbool $unique = trueiterablegetUidCountByGroupstring $groupintcloseClientstring $client, bool $force = falsebindUidstring $client, string $uidunBindUidstring $clientjoinGroupstring $client, string $groupleaveGroupstring $client, string $groupunGroupstring $groupsetSessionstring $client, array $sessionupdateSessionstring $client, array $sessiondeleteSessionstring $clientgetSessionstring $client?array

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.5% 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 ~5 days

Total

4

Last Release

1059d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8604f020ae5183c62fc47d11954a4b68ac7db1f79cb8cedf36c512903bd45efb?d=identicon)[heimi1985](/maintainers/heimi1985)

---

Top Contributors

[![xielei](https://avatars.githubusercontent.com/u/66499598?v=4)](https://github.com/xielei "xielei (55 commits)")[![heimi1985](https://avatars.githubusercontent.com/u/135006760?v=4)](https://github.com/heimi1985 "heimi1985 (2 commits)")

---

Tags

phpswoole

### Embed Badge

![Health badge](/badges/heimi-swoole-worker/health.svg)

```
[![Health](https://phpackages.com/badges/heimi-swoole-worker/health.svg)](https://phpackages.com/packages/heimi-swoole-worker)
```

###  Alternatives

[hyperf/hyperf-skeleton

A coroutine framework that focuses on hyperspeed and flexible, specifically use for build microservices and middlewares.

301187.4k](/packages/hyperf-hyperf-skeleton)

PHPackages © 2026

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