Skip to content

🚀🐇 Webman Coroutine Infrastructure Suite Compatible with Workerman

License

Notifications You must be signed in to change notification settings

webman-php/webman-coroutine

This branch is 3 commits behind workbunny/webman-coroutine:main.

Folders and files

NameName
Last commit message
Last commit date
Oct 12, 2024
Nov 9, 2024
Nov 9, 2024
Nov 9, 2024
Oct 12, 2024
Sep 26, 2024
Sep 26, 2024
Nov 9, 2024
Nov 7, 2024
Oct 10, 2024
Nov 7, 2024
Sep 30, 2024
Sep 26, 2024
Oct 12, 2024

Repository files navigation

中文 | English

workbunny

workbunny/webman-coroutine

🐇 Webman Coroutine Infrastructure Suite Compatible with Workerman. 🐇

Webman Coroutine Infrastructure Suite Compatible with Workerman.

Build Status Codecov Latest Stable Version PHP Version Require License

简介

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

起源

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

workbunny/webman-coroutine 插件诞生缘由及协程开发分享

目的

愿景

  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
教程 PHP 协程入门
- 安装及配置
- 助手函数
- workerman环境
- webman框架
- Utils说明
- 自定义拓展
- 协程的观测和管理

参与开发

规范

  • 新特性提交请先提交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生成文档

♨️ 相关文章

💕 致谢

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

About

🚀🐇 Webman Coroutine Infrastructure Suite Compatible with Workerman

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%