{"id":17437156,"url":"https://github.com/workbunny/webman-coroutine","last_synced_at":"2026-01-11T12:02:04.028Z","repository":{"id":257801393,"uuid":"863376386","full_name":"workbunny/webman-coroutine","owner":"workbunny","description":"🚀🐇 Webman Coroutine Infrastructure Suite Compatible with Workerman","archived":false,"fork":false,"pushed_at":"2025-04-24T13:54:22.000Z","size":693,"stargazers_count":73,"open_issues_count":0,"forks_count":12,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-13T04:57:40.749Z","etag":null,"topics":["coroutine","fiber","php","swoole","swow","webman"],"latest_commit_sha":null,"homepage":"https://www.workerman.net/plugin/167","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/workbunny.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-09-26T07:32:58.000Z","updated_at":"2025-06-24T07:27:06.000Z","dependencies_parsed_at":"2024-09-26T18:19:16.128Z","dependency_job_id":"22909658-960f-43b8-9e6b-c8e3e37af7a2","html_url":"https://github.com/workbunny/webman-coroutine","commit_stats":{"total_commits":234,"total_committers":8,"mean_commits":29.25,"dds":0.07692307692307687,"last_synced_commit":"1f136d32663bfc24057b1c6b4e0846f05ac87ab4"},"previous_names":["workbunny/webman-swow","workbunny/webman-coroutine"],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/workbunny/webman-coroutine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workbunny%2Fwebman-coroutine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workbunny%2Fwebman-coroutine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workbunny%2Fwebman-coroutine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workbunny%2Fwebman-coroutine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workbunny","download_url":"https://codeload.github.com/workbunny/webman-coroutine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workbunny%2Fwebman-coroutine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28302019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T11:18:18.743Z","status":"ssl_error","status_checked_at":"2026-01-11T11:07:56.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coroutine","fiber","php","swoole","swow","webman"],"created_at":"2024-10-17T11:06:13.588Z","updated_at":"2026-01-11T12:02:04.005Z","avatar_url":"https://github.com/workbunny.png","language":"PHP","readme":"#### 中文 | [English](README_en.md)\n\n\u003cp align=\"center\"\u003e\u003cimg width=\"260px\" src=\"https://chaz6chez.cn/images/workbunny-logo.png\" alt=\"workbunny\"\u003e\u003c/p\u003e\n\n**\u003cp align=\"center\"\u003eworkbunny/webman-coroutine\u003c/p\u003e**\n\n**\u003cp align=\"center\"\u003e🐇 Webman Coroutine Infrastructure Suite Compatible with Workerman. 🐇\u003c/p\u003e**\n\n# Webman Coroutine Infrastructure Suite Compatible with Workerman.\n\n[![Build Status](https://github.com/workbunny//webman-coroutine/actions/workflows/CI.yml/badge.svg)](https://github.com/workbunny//webman-coroutine/actions)\n[![Codecov](https://codecov.io/github/workbunny/webman-coroutine/branch/main/graph/badge.svg)](https://codecov.io/github/workbunny/webman-coroutine)\n[![Latest Stable Version](https://badgen.net/packagist/v/workbunny//webman-coroutine/latest)](https://github.com/workbunny//webman-coroutine/releases)\n[![PHP Version Require](https://badgen.net/packagist/php/workbunny//webman-coroutine)](https://github.com/workbunny//webman-coroutine/blob/main/composer.json)\n[![License](https://badgen.net/packagist/license/workbunny//webman-coroutine)](https://github.com/workbunny//webman-coroutine/blob/main/LICENSE)\n\n## 简介\n\n\u003e **🚀🐇 webman-coroutine 是一个支持 workerman / webman 开发框架生态下的协程基建支撑插件**\n\n### 起源\n\n- workerman 4.x 及基于其作为运行容器的 webman 框架不支持协程\n- workerman 5.x 及基于其作为运行容器的 webman 框架不具备完备的协程能力\n- workerman / webman 没有一个较为统一的协程使用方式，导致切换协程驱动的开发成本较高，试错成本较高\n- 自行实现协程版worker、server开发成本较高，试错成本较高\n\n\u003e [workbunny/webman-coroutine 插件诞生缘由及协程开发分享](https://www.workerman.net/a/1769)\n\n### 目的\n\n- 提供 `workerman`/`webman` 多样的基础协程事件库，兼容支持`workerman 4.x`和`workerman 5.x`的协程驱动\n  - [revolt/PHP-fiber](https://github.com/revoltphp/event-loop)\n  - [swow](https://github.com/swow/swow)\n  - [swoole](https://github.com/swoole/swoole-src)\n  - [ripple](https://github.com/cloudtay/ripple)\n  \n- 提供 `workerman`/`webman` 统一的协程开发工具，兼容非协程环境\n  - 协程通道：[Utils/Channel](https://github.com/workbunny/webman-coroutine/tree/main/src/Utils/Channel)\n  - 协程等待：[Utils/WaitGroup](https://github.com/workbunny/webman-coroutine/tree/main/src/Utils/WaitGroup)\n  - 协程：[Utils/Coroutine](https://github.com/workbunny/webman-coroutine/tree/main/src/Utils/Coroutine)\n  - 协程化Worker：[Utils/Worker](https://github.com/workbunny/webman-coroutine/tree/main/src/Utils/Worker)\n  - 对象池：[Utils/Pool](https://github.com/workbunny/webman-coroutine/tree/main/src/Utils/Pool)\n\n### 愿景\n\n1. 在 `workerman`/`webman` 开发环境下，提供一套简单的协程工具包，降低认知负荷。\n2. 在 `workerman`/`webman` 开发环境下，尝试实现一套兼容协程与非协程开发的方案，让选择和摆脱方案更简单，避免更多的焦虑。\n3. 在 `workerman`/`webman` 开发环境下，尽可能实现对官方组件的无侵入式协程化改造`(虽然很难，但也想试试)`。\n4. 希望在代码的实现上能够给更多PHP开发带来一些帮助，甚至灵感。\n\n## 安装\n\n通过`composer`安装\n\n```php\ncomposer require workbunny/webman-coroutine\n```\n\n## 目录\n\n```\n|-- config                       # webman 配置文件\n    |-- plugin\n        |-- webman-coroutine\n            |-- app.php          # 主配置信息\n            |-- process.php      # 启动进程\n|-- Events                       # workerman-4.x 事件驱动文件\n|-- Exceptions                   # 异常\n|-- Handlers                     # 入口主驱动\n|-- Utils                        # 工具包\n    |-- Channel                  # 通道 驱动\n    |-- Coroutine                # 协程 驱动\n    |-- WaitGroup                # wait group 驱动\n    |-- Worker                   # worker 驱动\n    |-- Pool                     # 对象池 驱动\n    |-- RegisterMethods.php      # 驱动注册助手\n|-- Factory                      # 入口类\n|-- CoroutineWebServer.php       # webman 自定义http服务\n|-- helpers.php                  # 入口助手          \n```\n\n## 文档\n\n| 目录  |                                                   地址                                                   |\n|:---:|:------------------------------------------------------------------------------------------------------:|\n| API |                     [Fucntion-APIs](https://workbunny.github.io/webman-coroutine/)                     |\n| 教程  |        [PHP 协程入门](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/coroutine.md)       |\n|  -  |          [安装及配置](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/install.md)          |\n|  -  |           [助手函数](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/helpers.md)          |\n|  -  |     [`workerman`环境](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/workerman.md)     |\n|  -  |        [`webman`框架](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/webman.md)        |\n|  -  |         [`Utils`说明](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/utils.md)         |\n|  -  |           [自定义拓展](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/custom.md)          |\n|  -  | [协程的观测和管理](https://github.com/workbunny/webman-coroutine/tree/main/docs/doc/suspension-manage.md) |\n\n## 参与开发\n\n- [Issues](https://github.com/workbunny/webman-coroutine/issues)\n- [PR](https://github.com/workbunny/webman-coroutine/pulls)\n\n### 规范\n\n- 新特性提交请先提交feature-issue，再提交PR，避免重复开发；\n- Bug修复请先提交bug-repo-issue，再提交PR，避免重复开发；\n\n### 工具\n\n- 代码格式化：`composer cs-fix`\n- 静态检查：`composer php-stan`\n- 测试与覆盖：`composer unit-test`，命令运行后会在项目创建的`coverage`目录下生成报告\n- function-apis文档生成：\n  - 使用`composer doc-install`或自行安装phpDocumentor\n  - 在项目根目录使用`phpDocumentor`生成文档\n\n## ♨️ 相关文章\n\n* [webman如何使用swow事件驱动和协程？](https://mp.weixin.qq.com/s?__biz=MzUzMDMxNTQ4Nw==\u0026mid=2247496493\u0026idx=1\u0026sn=4ab95befc894d556eac26d405f354a40\u0026chksm=fa51129dcd269b8b61fc5b1a15a9a23b99b61c0780b9a341dfe3733692e85a1bc5e323ee9775#rd)\n* [PHP高性能纯协程网络通信引擎Swow](https://mp.weixin.qq.com/s?__biz=MzUzMDMxNTQ4Nw==\u0026mid=2247496428\u0026idx=1\u0026sn=5f1fef3a49e3ab20ea1fa43242ac8af7\u0026chksm=fa51135ccd269a4aac1255323faeea670238777c37fec6fb6bdef0ead857ba492c1265c03bff#rd)\n* [workerman5.0 和 swoole5.0 实现一键协程](https://mp.weixin.qq.com/s?__biz=MzUzMDMxNTQ4Nw==\u0026mid=2247492324\u0026idx=1\u0026sn=ac697103fe56d6054593ae6d1bdadb93\u0026chksm=fa510354cd268a4298eee50483821fff3ebb52a923a6a67708759ea4c5836649c85700f9ad12#rd)\n* [webman如何使用swoole事件驱动和协程？](https://mp.weixin.qq.com/s?__biz=MzUzMDMxNTQ4Nw==\u0026mid=2247489841\u0026idx=1\u0026sn=52e9a57e511870c68daa2b10b78bf3a2\u0026chksm=fa52f881cd25719782e3162108426a127b80599df80633d5edcf164162a69dc3518a9ec9cd29#rd)\n\n## 💕 致谢\n\u003e **💕感恩 workerman 和 swow 开发团队为 PHP 社区带来的创新和卓越贡献，让我们共同期待 PHP 在实时应用领域的更多突破！！！**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkbunny%2Fwebman-coroutine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkbunny%2Fwebman-coroutine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkbunny%2Fwebman-coroutine/lists"}