PHPackages                             mingfei/querylist-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. mingfei/querylist-coroutine

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

mingfei/querylist-coroutine
===========================

QueryList Plugin: 协程插件

1.0.0(4y ago)03MITPHPPHP &gt;=7.0

Since Feb 25Pushed 4y agoCompare

[ Source](https://github.com/mingfei58/querylist-coroutine)[ Packagist](https://packagist.org/packages/mingfei/querylist-coroutine)[ RSS](/packages/mingfei-querylist-coroutine/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

QueryList-Coroutine
===================

[](#querylist-coroutine)

QueryList Plugin: Coroutine

Installation
------------

[](#installation)

```
composer require mingfei/querylist-coroutine

```

API
---

[](#api)

- Coroutine **coroutine(int $size=0)**:use Coroutine QueryList.

class **Coroutine**:

- Coroutine **size($size)**:set max parallel num.
- Coroutine **add(string $option)**：add option.
- Coroutine **success(callable $callable)**: success callback.
- Coroutine **wait($post)**: wait for request.

Usage
-----

[](#usage)

- Bind Coroutine

```
use QL\QueryList;
use QL\Ext\Coroutine;

$ql = new QueryList();
$ql->use(Coroutine::class);
//or Custom function name
$ql->use(Coroutine::class,'coroutine');
```

- Your Rule like this

```
$rule = [
    'package' => ['.col-sm-9>h4>a','text'],
    'link' => ['.col-sm-9>h4>a','href'],
    'desc'=>['.col-sm-9>p:last','text'],
    'language'=>['.col-sm-9>p:eq(0)','text'],
    'star'=>['.col-sm-3 span:eq(1)','text'],
];
$range = "li .row";
```

- Use Coroutine

```
$coroutine = $ql->range($range)->rules($rule)->coroutine();
$coroutine->add("https://packagist.org/explore/popular");
$data = $coroutine->wait();
print_r($data->all());
```

- Use Coroutine with success callback

```
$coroutine = $ql->range($range)->rules($rule)->coroutine();
$coroutine->add("https://packagist.org/explore/popular");
$coroutine->success(function($item){
    $item["star"]  = preg_replace('/\D/s', '', $item["star"] );
    return $item;
});
$data = $coroutine->wait();
print_r($data->all());
```

Out:

```
Array
(
     [0] => Array
        (
            [package] => symfony/polyfill-mbstring
            [link] => /packages/symfony/polyfill-mbstring
            [desc] => Symfony polyfill for the Mbstring extension
            [language] => PHP
            [star] => 7373
        )

    [1] => Array
        (
            [package] => psr/log
            [link] => /packages/psr/log
            [desc] => Common interface for logging libraries
            [language] => PHP
            [star] => 9976
        )
	...
)

```

- Use Coroutine with size

```
$coroutine = $ql->range($range)->rules($rule)->coroutine(1000);
$range = range(1,10000);
foreach($range as $i){
    $coroutine->add("https://packagist.org/explore/popular?page=".$i);
}
$data = $coroutine->wait();
print_r($data->all());
//爬取速度受packagist.org并发限制，这里大约需要等几分钟
```

Out:

```
use 424.99214887619s

```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

1543d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9cb7b2ed4bcc087c31ceb07cd7615a8d1864e89515c1e5ce1eb8eec4611c5fcb?d=identicon)[mingfei](/maintainers/mingfei)

### Embed Badge

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

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

###  Alternatives

[jofrysutanto/windsor

YAML-ised Configuration for ACF

549.2k](/packages/jofrysutanto-windsor)[jshannon63/jsoncollect

Supercharge your JSON using collections

154.9k1](/packages/jshannon63-jsoncollect)

PHPackages © 2026

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