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 3w 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 35% 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

2982d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3760284?v=4)[ziqing](/maintainers/ziqing)[@ziqing](https://github.com/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

[symfony/lock

Creates and manages locks, a mechanism to provide exclusive access to a shared resource

514139.2M681](/packages/symfony-lock)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k49](/packages/ecotone-ecotone)[civicrm/civicrm-core

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

751291.4k40](/packages/civicrm-civicrm-core)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)[logiscape/mcp-sdk-php

Model Context Protocol SDK for PHP

368116.8k12](/packages/logiscape-mcp-sdk-php)

PHPackages © 2026

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