PHPackages                             ctfang/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. [Testing &amp; Quality](/categories/testing)
4. /
5. ctfang/coroutine

ActiveUtopia-extension[Testing &amp; Quality](/categories/testing)

ctfang/coroutine
================

test the coroutine

0.0.1(7y ago)3141PHP

Since Nov 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ctfang/utopia-coroutine)[ Packagist](https://packagist.org/packages/ctfang/coroutine)[ RSS](/packages/ctfang-coroutine/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (2)Used By (0)

utopia-coroutine
================

[](#utopia-coroutine)

原生协程

```
$scheduler = new \Utopia\Co\Scheduler();
$dbConfig = new \Utopia\Co\Client\Mysql\Config();
$dbConfig->set(
    [
        "count"    => '2',// 连接池数量
        "host"     => '192.168.100.99',
        "user"     => 'root',
        "password" => '123456',
        "database" => 'test',
    ]
);
Db::addConnect($dbConfig);

go(function (){
    $data[] = yield Db::query('select sleep(2)');
    var_dump($data);
});
go(function (){
    echo "协程 1 开始\n";
    for ($i=0;$irun();
    $timeout = $hasCo?0:null;
    /**
     * 根据是否还有协程，设置超时时间
     * stream_select($rSocks, $wSocks, $eSocks, $timeout)
     */
}
```

协程异步执sql

```
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

2780d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6645de82017106e5f82dff108225c338183991e509d3a5be8d5946a38e623436?d=identicon)[selden1992](/maintainers/selden1992)

---

Top Contributors

[![ctfang](https://avatars.githubusercontent.com/u/18717080?v=4)](https://github.com/ctfang "ctfang (6 commits)")

### Embed Badge

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

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

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14228.7M341](/packages/dms-phpunit-arraysubset-asserts)[phpbenchmark/phpbenchmark

Easy to use benchmark toolkit for your PHP-application. This library contains classes for comparing algorithms as well as benchmarking application responses

8011.5k2](/packages/phpbenchmark-phpbenchmark)

PHPackages © 2026

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