PHPackages                             workbunny/webman-coroutine - 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. workbunny/webman-coroutine

ActiveLibrary[Framework](/categories/framework)

workbunny/webman-coroutine
==========================

Webman Coroutine Infrastructure Suite Compatible with Workerman.

1.3.5(1y ago)7461113Apache-2.0PHPPHP ^8.0CI passing

Since Sep 26Pushed 1y agoCompare

[ Source](https://github.com/workbunny/webman-coroutine)[ Packagist](https://packagist.org/packages/workbunny/webman-coroutine)[ RSS](/packages/workbunny-webman-coroutine/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (36)Used By (0)

#### 中文 | [English](README_en.md)

[](#中文--english)

[![workbunny](https://camo.githubusercontent.com/e2b1164338390ab45783434659e3e419e0c3b50fbe140c697ba1f82f59015ad6/68747470733a2f2f6368617a366368657a2e636e2f696d616765732f776f726b62756e6e792d6c6f676f2e706e67)](https://camo.githubusercontent.com/e2b1164338390ab45783434659e3e419e0c3b50fbe140c697ba1f82f59015ad6/68747470733a2f2f6368617a366368657a2e636e2f696d616765732f776f726b62756e6e792d6c6f676f2e706e67)

**workbunny/webman-coroutine**

**🐇 Webman Coroutine Infrastructure Suite Compatible with Workerman. 🐇**

Webman Coroutine Infrastructure Suite Compatible with Workerman.
================================================================

[](#webman-coroutine-infrastructure-suite-compatible-with-workerman)

[![Build Status](https://github.com/workbunny//webman-coroutine/actions/workflows/CI.yml/badge.svg)](https://github.com/workbunny//webman-coroutine/actions)[![Codecov](https://camo.githubusercontent.com/9ebe74ce9e815cb4250ac5842e7f942164cd8861b57518b1bca0d04a88a9134a/68747470733a2f2f636f6465636f762e696f2f6769746875622f776f726b62756e6e792f7765626d616e2d636f726f7574696e652f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/github/workbunny/webman-coroutine)[![Latest Stable Version](https://camo.githubusercontent.com/b83df745bbb43a4713f1fe9df6d9ba013d2e6e390262ef445ecae313c8dfbadc/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f776f726b62756e6e792f2f7765626d616e2d636f726f7574696e652f6c6174657374)](https://github.com/workbunny//webman-coroutine/releases)[![PHP Version Require](https://camo.githubusercontent.com/00765ff29776ad5428db2680802686a095f89a22bdd099a03e08d6a079d6e26e/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f776f726b62756e6e792f2f7765626d616e2d636f726f7574696e65)](https://github.com/workbunny//webman-coroutine/blob/main/composer.json)[![License](https://camo.githubusercontent.com/a8ef84bd8d443532678210fa00d8276be66f13849b8a484ac47e7917f69c4d25/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f6c6963656e73652f776f726b62756e6e792f2f7765626d616e2d636f726f7574696e65)](https://github.com/workbunny//webman-coroutine/blob/main/LICENSE)

简介
--

[](#简介)

> **🚀🐇 webman-coroutine 是一个支持 workerman / webman 开发框架生态下的协程基建支撑插件**

### 起源

[](#起源)

- workerman 4.x 及基于其作为运行容器的 webman 框架不支持协程
- workerman 5.x 及基于其作为运行容器的 webman 框架不具备完备的协程能力
- workerman / webman 没有一个较为统一的协程使用方式，导致切换协程驱动的开发成本较高，试错成本较高
- 自行实现协程版worker、server开发成本较高，试错成本较高

> [workbunny/webman-coroutine 插件诞生缘由及协程开发分享](https://www.workerman.net/a/1769)

### 目的

[](#目的)

- 提供 `workerman`/`webman` 多样的基础协程事件库，兼容支持`workerman 4.x`和`workerman 5.x`的协程驱动

    - [revolt/PHP-fiber](https://github.com/revoltphp/event-loop)
    - [swow](https://github.com/swow/swow)
    - [swoole](https://github.com/swoole/swoole-src)
    - [ripple](https://github.com/cloudtay/ripple)
- 提供 `workerman`/`webman` 统一的协程开发工具，兼容非协程环境

    - 协程通道：[Utils/Channel](https://github.com/workbunny/webman-coroutine/tree/main/src/Utils/Channel)
    - 协程等待：[Utils/WaitGroup](https://github.com/workbunny/webman-coroutine/tree/main/src/Utils/WaitGroup)
    - 协程：[Utils/Coroutine](https://github.com/workbunny/webman-coroutine/tree/main/src/Utils/Coroutine)
    - 协程化Worker：[Utils/Worker](https://github.com/workbunny/webman-coroutine/tree/main/src/Utils/Worker)
    - 对象池：[Utils/Pool](https://github.com/workbunny/webman-coroutine/tree/main/src/Utils/Pool)

### 愿景

[](#愿景)

1. 在 `workerman`/`webman` 开发环境下，提供一套简单的协程工具包，降低认知负荷。
2. 在 `workerman`/`webman` 开发环境下，尝试实现一套兼容协程与非协程开发的方案，让选择和摆脱方案更简单，避免更多的焦虑。
3. 在 `workerman`/`webman` 开发环境下，尽可能实现对官方组件的无侵入式协程化改造`(虽然很难，但也想试试)`。
4. 希望在代码的实现上能够给更多PHP开发带来一些帮助，甚至灵感。

安装
--

[](#安装)

通过`composer`安装

```
composer require workbunny/webman-coroutine
```

目录
--

[](#目录)

```
|-- config                       # webman 配置文件
    |-- plugin
        |-- webman-coroutine
            |-- app.php          # 主配置信息
            |-- process.php      # 启动进程
|-- Events                       # workerman-4.x 事件驱动文件
|-- Exceptions                   # 异常
|-- Handlers                     # 入口主驱动
|-- Utils                        # 工具包
    |-- Channel                  # 通道 驱动
    |-- Coroutine                # 协程 驱动
    |-- WaitGroup                # wait group 驱动
    |-- Worker                   # worker 驱动
    |-- Pool                     # 对象池 驱动
    |-- RegisterMethods.php      # 驱动注册助手
|-- Factory                      # 入口类
|-- CoroutineWebServer.php       # webman 自定义http服务
|-- helpers.php                  # 入口助手

```

文档
--

[](#文档)

目录地址API[Fucntion-APIs](https://workbunny.github.io/webman-coroutine/)教程[PHP 协程入门](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/coroutine.md)-[安装及配置](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/install.md)-[助手函数](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/helpers.md)-[`workerman`环境](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/workerman.md)-[`webman`框架](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/webman.md)-[`Utils`说明](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/utils.md)-[自定义拓展](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/custom.md)-[协程的观测和管理](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/suspension-manage.md)参与开发
----

[](#参与开发)

- [Issues](https://github.com/workbunny/webman-coroutine/issues)
- [PR](https://github.com/workbunny/webman-coroutine/pulls)

### 规范

[](#规范)

- 新特性提交请先提交feature-issue，再提交PR，避免重复开发；
- Bug修复请先提交bug-repo-issue，再提交PR，避免重复开发；

### 工具

[](#工具)

- 代码格式化：`composer cs-fix`
- 静态检查：`composer php-stan`
- 测试与覆盖：`composer unit-test`，命令运行后会在项目创建的`coverage`目录下生成报告
- function-apis文档生成：
    - 使用`composer doc-install`或自行安装phpDocumentor
    - 在项目根目录使用`phpDocumentor`生成文档

♨️ 相关文章
-------

[](#️-相关文章)

- [webman如何使用swow事件驱动和协程？](https://mp.weixin.qq.com/s?__biz=MzUzMDMxNTQ4Nw==&mid=2247496493&idx=1&sn=4ab95befc894d556eac26d405f354a40&chksm=fa51129dcd269b8b61fc5b1a15a9a23b99b61c0780b9a341dfe3733692e85a1bc5e323ee9775#rd)
- [PHP高性能纯协程网络通信引擎Swow](https://mp.weixin.qq.com/s?__biz=MzUzMDMxNTQ4Nw==&mid=2247496428&idx=1&sn=5f1fef3a49e3ab20ea1fa43242ac8af7&chksm=fa51135ccd269a4aac1255323faeea670238777c37fec6fb6bdef0ead857ba492c1265c03bff#rd)
- [workerman5.0 和 swoole5.0 实现一键协程](https://mp.weixin.qq.com/s?__biz=MzUzMDMxNTQ4Nw==&mid=2247492324&idx=1&sn=ac697103fe56d6054593ae6d1bdadb93&chksm=fa510354cd268a4298eee50483821fff3ebb52a923a6a67708759ea4c5836649c85700f9ad12#rd)
- [webman如何使用swoole事件驱动和协程？](https://mp.weixin.qq.com/s?__biz=MzUzMDMxNTQ4Nw==&mid=2247489841&idx=1&sn=52e9a57e511870c68daa2b10b78bf3a2&chksm=fa52f881cd25719782e3162108426a127b80599df80633d5edcf164162a69dc3518a9ec9cd29#rd)

💕 致谢
----

[](#-致谢)

> **💕感恩 workerman 和 swow 开发团队为 PHP 社区带来的创新和卓越贡献，让我们共同期待 PHP 在实时应用领域的更多突破！！！**

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance47

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.6% 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 ~6 days

Recently: every ~42 days

Total

35

Last Release

389d ago

Major Versions

0.2.1 → 1.0.0-alpha.12024-10-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/d1b317277226c93c11984f73dfad75533893466b02d06611126aa1687209c6ab?d=identicon)[Chaz6Chez](/maintainers/Chaz6Chez)

---

Top Contributors

[![chaz6chez](https://avatars.githubusercontent.com/u/22535862?v=4)](https://github.com/chaz6chez "chaz6chez (280 commits)")[![Tinywan](https://avatars.githubusercontent.com/u/14959876?v=4)](https://github.com/Tinywan "Tinywan (6 commits)")[![cclilshy](https://avatars.githubusercontent.com/u/59851383?v=4)](https://github.com/cclilshy "cclilshy (5 commits)")[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (2 commits)")[![kylin987](https://avatars.githubusercontent.com/u/26080774?v=4)](https://github.com/kylin987 "kylin987 (2 commits)")[![NathanFreeman](https://avatars.githubusercontent.com/u/33935209?v=4)](https://github.com/NathanFreeman "NathanFreeman (2 commits)")[![sunsgneayo](https://avatars.githubusercontent.com/u/51745500?v=4)](https://github.com/sunsgneayo "sunsgneayo (1 commits)")[![JinBorn](https://avatars.githubusercontent.com/u/29768328?v=4)](https://github.com/JinBorn "JinBorn (1 commits)")

---

Tags

coroutinefiberphpswooleswowwebman

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/workbunny-webman-coroutine/health.svg)

```
[![Health](https://phpackages.com/badges/workbunny-webman-coroutine/health.svg)](https://phpackages.com/packages/workbunny-webman-coroutine)
```

###  Alternatives

[workerman/webman-framework

High performance HTTP Service Framework.

149314.9k256](/packages/workerman-webman-framework)[gotzmann/comet

Modern PHP framework for building blazing fast REST APIs and microservices

68816.2k1](/packages/gotzmann-comet)[kiddyu/beanbun

Beanbun 是用 PHP 编写的多进程网络爬虫框架，具有良好的开放性、高可扩展性

1.3k4.1k](/packages/kiddyu-beanbun)[qingwuit/qwshop

laravel+vue for b2b2c.

1002.8k](/packages/qingwuit-qwshop)

PHPackages © 2026

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