PHPackages                             tourze/workerman-runtime-context-bundle - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tourze/workerman-runtime-context-bundle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tourze/workerman-runtime-context-bundle
=======================================

Workerman Runtime Context bundle

1.0.1(7mo ago)0253↓92.2%2MITPHPCI passing

Since Apr 24Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/tourze/workerman-runtime-context-bundle)[ Packagist](https://packagist.org/packages/tourze/workerman-runtime-context-bundle)[ RSS](/packages/tourze-workerman-runtime-context-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (15)Versions (6)Used By (2)

Workerman Runtime Context Bundle
================================

[](#workerman-runtime-context-bundle)

[English](README.md) | [中文](README.zh-CN.md)

[![Latest Version](https://camo.githubusercontent.com/3ac7d7916c80e0ad7b559018fd31259fd2d6e64ea9f76241de72d4cffa2906e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f776f726b65726d616e2d72756e74696d652d636f6e746578742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/workerman-runtime-context-bundle)[![PHP Version](https://camo.githubusercontent.com/6fe89667b268add3fb7cd730359c15ae3752644c4f052c4733283bf12018aaab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f746f75727a652f776f726b65726d616e2d72756e74696d652d636f6e746578742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/workerman-runtime-context-bundle)[![License](https://camo.githubusercontent.com/1b4067a0ffe143543b2f9575717690a4b2896cf5857cc4ca87a00843f902ca5a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f746f75727a652f776f726b65726d616e2d72756e74696d652d636f6e746578742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/workerman-runtime-context-bundle)[![Build Status](https://camo.githubusercontent.com/c9019fc318bc76ec721e7f9c8e10800ce07592b3a0da918c9b31de9967db3de6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f746f75727a652f776f726b65726d616e2d72756e74696d652d636f6e746578742d62756e646c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/tourze/workerman-runtime-context-bundle)[![Quality Score](https://camo.githubusercontent.com/dc507c9eebc3b9ae34cb58484083449059f757e6b240ad87ff3240ed16c7cda5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f746f75727a652f776f726b65726d616e2d72756e74696d652d636f6e746578742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/tourze/workerman-runtime-context-bundle)[![Code Coverage](https://camo.githubusercontent.com/3edfac0464ad97cf11a7d1109046b4584df5bb8baee270e3993d9dd110b3425e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f746f75727a652f776f726b65726d616e2d72756e74696d652d636f6e746578742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/tourze/workerman-runtime-context-bundle)[![Total Downloads](https://camo.githubusercontent.com/e9048ccd9485ad437e3bbc46bffc1143e81a25536bb05061d205e9a163bb1cfb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f776f726b65726d616e2d72756e74696d652d636f6e746578742d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/workerman-runtime-context-bundle)

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
--------

[](#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
------------

[](#installation)

- PHP &gt;= 8.1
- Symfony 6.4 or higher
- Workerman &gt;= 5.1

Install via Composer:

```
composer require tourze/workerman-runtime-context-bundle
```

Quick Start
-----------

[](#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],
];
```

2. 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
    });
}
```

3. See [examples/](./examples/) for advanced coroutine and context isolation usage, including Fiber, connection pool, and concurrency model tests.

Documentation
-------------

[](#documentation)

- [Coroutine Context Isolation](./examples/coroutine/README.md): How context is isolated between coroutines
- [Connection Pool Usage](./examples/coroutine/README.md): Resource sharing and reuse
- [Concurrency Model Comparison](./examples/coroutine/README.md): Serial, Parallel, Barrier, Channel models

Advanced Configuration
----------------------

[](#advanced-configuration)

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

Contributing
------------

[](#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
-------

[](#license)

MIT License. See [LICENSE](./LICENSE) for details.

Authors
-------

[](#authors)

tourze

Changelog
---------

[](#changelog)

See [Releases](https://github.com/tourze/workerman-runtime-context-bundle/releases) for version history and upgrade notes.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance65

Regular maintenance activity

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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 ~50 days

Total

5

Last Release

233d ago

Major Versions

0.0.3 → 1.0.02025-11-01

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13899502?v=4)[tourze](/maintainers/tourze)[@tourze](https://github.com/tourze)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-workerman-runtime-context-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-workerman-runtime-context-bundle/health.svg)](https://phpackages.com/packages/tourze-workerman-runtime-context-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M576](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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