定制 tourze/workerman-runtime-context-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tourze/workerman-runtime-context-bundle

最新稳定版本:1.0.1

Composer 安装命令:

composer require tourze/workerman-runtime-context-bundle

包简介

Workerman Runtime Context bundle

README 文档

README

English | 中文

Latest Version PHP Version License Build Status Quality Score Code Coverage Total Downloads

A Symfony bundle that enables efficient coroutine context management for Workerman v5 event loop, providing context isolation and coroutine-friendly service integration with minimal code changes.

Features

  • Seamless integration of Workerman coroutine context into Symfony applications
  • Automatic context isolation for each coroutine (Fiber, Swoole, Swow)
  • Support for context-aware connection pools and resource management
  • Compatible with Symfony 6.4+
  • Minimal or zero code modification needed in your existing Symfony app

Installation

  • PHP >= 8.1
  • Symfony 6.4 or higher
  • Workerman >= 5.1

Install via Composer:

composer require tourze/workerman-runtime-context-bundle

Quick Start

  1. Enable the bundle in your Symfony application (usually auto-registered via Flex):
// config/bundles.php
return [
    // ...
    Tourze\WorkermanRuntimeContextBundle\WorkermanRuntimeContextBundle::class => ['all' => true],
];
  1. Use context-aware services in your code. For example, to defer a callback in coroutine:
use Tourze\Symfony\RuntimeContextBundle\Service\ContextServiceInterface;

public function someMethod(ContextServiceInterface $contextService)
{
    $contextService->defer(function () {
        // This will be executed at the end of the coroutine
    });
}
  1. See examples/ for advanced coroutine and context isolation usage, including Fiber, connection pool, and concurrency model tests.

Documentation

Advanced Configuration

This bundle automatically decorates the default ContextServiceInterface to provide Workerman coroutine support. No manual configuration is required for most use cases.

Contributing

  • Please submit issues and pull requests via GitHub
  • Follow PSR coding standards and Symfony best practices
  • Run tests via PHPUnit before submitting PRs

License

MIT License. See LICENSE for details.

Authors

tourze https://github.com/tourze

Changelog

See Releases for version history and upgrade notes.

统计信息

  • 总下载量: 249
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固