PHPackages                             lanzhi/php-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lanzhi/php-coroutine

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

lanzhi/php-coroutine
====================

php coroutine

0.1(8y ago)0681MITPHPPHP &gt;=7.0

Since Apr 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ziqingliang/php-coroutine)[ Packagist](https://packagist.org/packages/lanzhi/php-coroutine)[ RSS](/packages/lanzhi-php-coroutine/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (17)Used By (1)

php-coroutine
=============

[](#php-coroutine)

PHP 协程抽象工具

使用案例：

```
include __DIR__."/../vendor/autoload.php";

use lanzhi\coroutine\AbstractRoutine;
use lanzhi\coroutine\Scheduler;

class Routine1 extends AbstractRoutine
{
    protected function generate() : Generator
    {
        yield;
        echo get_called_class() , ": step 1\n";

        yield;
        echo get_called_class(), ": step 2\n";

        yield;
        echo get_called_class(), ": step 3\n";

        return get_called_class() . ": return";
    }
}
class Routine2 extends AbstractRoutine
{
    protected function generate() : Generator
    {
        yield;
        echo get_called_class() , ": step 1\n";

        yield;
        echo get_called_class(), ": step 2\n";

        yield;
        echo get_called_class(), ": step 3\n";

        return get_called_class() . ": return";
    }
}

$scheduler = Scheduler::getInstance();

$scheduler->register(new Routine1());
$scheduler->register(new Routine2());

$scheduler->run();
```

Output：

```
Routine1: step 1
Routine2: step 1
Routine1: step 2
Routine2: step 2
Routine1: step 3
Routine2: step 3
```

#### 联系作者

[](#联系作者)

QQ : 310929334
微信: lanzhi\_me

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

Total

16

Last Release

2934d ago

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/lanzhi-php-coroutine/health.svg)

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

###  Alternatives

[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[j0k3r/php-readability

Automatic article extraction from HTML

186808.8k6](/packages/j0k3r-php-readability)[symfony/ai-platform

PHP library for interacting with AI platform provider.

51927.7k136](/packages/symfony-ai-platform)[symfony/ai-agent

PHP library for building agentic applications.

30536.7k44](/packages/symfony-ai-agent)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)

PHPackages © 2026

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