PHPackages                             wangrunxinyes/easyswoole-component - 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. [Framework](/categories/framework)
4. /
5. wangrunxinyes/easyswoole-component

ActiveLibrary[Framework](/categories/framework)

wangrunxinyes/easyswoole-component
==================================

easyswoole component

1.0.0(5y ago)0111Apache-2.0PHPPHP &gt;=7.1.0

Since Jan 18Pushed 5y agoCompare

[ Source](https://github.com/wangrunxinyes/component)[ Packagist](https://packagist.org/packages/wangrunxinyes/easyswoole-component)[ Docs](https://www.easyswoole.com/)[ RSS](/packages/wangrunxinyes-easyswoole-component/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (2)Used By (1)

CoroutineRunner
---------------

[](#coroutinerunner)

```
use EasySwoole\Component\CoroutineRunner\Runner;
use Swoole\Coroutine\Scheduler;
use EasySwoole\Component\CoroutineRunner\Task;
$scheduler = new Scheduler;
$scheduler->add(function () {
    $runner = new Runner(4);
    $i = 10;
    while ($i){
        $runner->addTask(new Task(function ()use($runner,$i){
            var_dump("now is num.{$i} at time ".time());
            \co::sleep(1);

            if($i == 5){
                $runner->addTask(new Task(function (){
                    var_dump('this is task add in running');
                }));
            }

        }));
        $i--;
    }
    $runner->start();
    var_dump('task finish');
});
$scheduler->start();

```

PoolInterface Example1
----------------------

[](#poolinterface-example1)

```
use EasySwoole\Component\Pool\PoolManager;
use EasySwoole\Component\Pool\TraitObjectInvoker;
use EasySwoole\Utility\Random;
use EasySwoole\Component\Pool\AbstractPoolObject;
use EasySwoole\Component\Pool\PoolObjectInterface;
use EasySwoole\Component\Pool\AbstractPool;
class test
{
    public $id;

    function __construct()
    {
        $this->id = Random::character(8);
    }

    function fuck(){
        var_dump('this is fuck at class:'.static::class.'@id:'.$this->id);
    }
}

class test2 extends test implements PoolObjectInterface
{
    function objectRestore()
    {
        var_dump('this is objectRestore at class:'.static::class.'@id:'.$this->id);
    }

    function gc()
    {
        // TODO: Implement gc() method.
    }

    function beforeUse(): bool
    {
        // TODO: Implement beforeUse() method.
        return true;
    }
}

class testPool extends AbstractPool
{

    protected function createObject()
    {
        // TODO: Implement createObject() method.
        return new test();
    }
}

class testPool2 extends AbstractPool
{

    protected function createObject()
    {
        // TODO: Implement createObject() method.
        return new test2();
    }
}

class test3 extends test
{
    use TraitObjectInvoker;
}

class test4 extends AbstractPoolObject
{
    function finalFuck()
    {
        var_dump('final fuck');
    }

    function objectRestore()
    {
        var_dump('final objectRestore');
    }
}

//cli下关闭pool的自动定时检查
PoolManager::getInstance()->getDefaultConfig()->setIntervalCheckTime(0);

go(function (){
    go(function (){
        $object = PoolManager::getInstance()->getPool(test::class)->getObj();
        $object->fuck();
        PoolManager::getInstance()->getPool(test::class)->recycleObj($object);
    });

    go(function (){
        testPool::invoke(function (test $test){
            $test->fuck();
        });
    });

    go(function (){
        testPool2::invoke(function (test2 $test){
            $test->fuck();
        });
    });

    go(function (){
        test3::invoke(function (test3 $test3){
            $test3->fuck();
        });
    });

    go(function (){
        $object = PoolManager::getInstance()->getPool(test4::class)->getObj();
        $object->finalFuck();
        PoolManager::getInstance()->getPool(test4::class)->recycleObj($object);
    });
});

```

PoolInterface Example2
----------------------

[](#poolinterface-example2)

```
use EasySwoole\Component\Pool\PoolManager;
use EasySwoole\Component\Pool\AbstractPool;
use EasySwoole\Component\Pool\TraitInvoker;

class TestPool extends AbstractPool{
    function __construct(\EasySwoole\Component\Pool\PoolConf $conf)
    {
        var_dump('new TestPool');
        parent::__construct($conf);
    }

    protected function createObject()
    {
        // TODO: Implement createObject() method.
        return new \stdClass();
    }

}

class TestPool2
{
    use TraitInvoker;
    function __construct()
    {
        var_dump('new TestPool2');
    }

    function fuck()
    {
        var_dump('fuck');
    }

}

go(function (){
    PoolManager::getInstance()->registerAnonymous('test',function (){
        return new SplFixedArray();
    });
    $pool = PoolManager::getInstance()->getPool(stdClass::class);
    $pool2 = PoolManager::getInstance()->getPool(\Redis::class);
    $pool3 = PoolManager::getInstance()->getPool('test');
    $pool::invoke(function (stdClass $class){
        var_dump($class);
    });
    $pool2::invoke(function (\Redis $class){
        var_dump($class);
    });
    $pool3::invoke(function (SplFixedArray $array){
        var_dump($array);
    });

    TestPool::invoke(function (\stdClass $class){
//        var_dump($class);
    });

    $pool4 = PoolManager::getInstance()->getPool(TestPool::class);
    $pool4::invoke(function (\stdClass $class){
//        var_dump($class);
    });

    TestPool2::invoke(function ($class){
        $class->fuck();
    });
    $pool5 = PoolManager::getInstance()->getPool(TestPool2::class);
    $pool5::invoke(function (\TestPool2 $class){
//        $class->fuck();
    });

});

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.6% 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

1937d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1cf057c48c552ae99a41792b1df6704e1a5348a181c5b2098087face419e38d0?d=identicon)[wangrunxinyes](/maintainers/wangrunxinyes)

---

Top Contributors

[![kiss291323003](https://avatars.githubusercontent.com/u/24490609?v=4)](https://github.com/kiss291323003 "kiss291323003 (155 commits)")[![evalor](https://avatars.githubusercontent.com/u/26944445?v=4)](https://github.com/evalor "evalor (5 commits)")[![willove](https://avatars.githubusercontent.com/u/5616317?v=4)](https://github.com/willove "willove (2 commits)")[![xiaocaigua](https://avatars.githubusercontent.com/u/11884276?v=4)](https://github.com/xiaocaigua "xiaocaigua (2 commits)")[![Yaphats](https://avatars.githubusercontent.com/u/2899971?v=4)](https://github.com/Yaphats "Yaphats (2 commits)")[![ar026](https://avatars.githubusercontent.com/u/24467915?v=4)](https://github.com/ar026 "ar026 (1 commits)")[![voocel](https://avatars.githubusercontent.com/u/21246707?v=4)](https://github.com/voocel "voocel (1 commits)")[![wangrunxinyes](https://avatars.githubusercontent.com/u/10919227?v=4)](https://github.com/wangrunxinyes "wangrunxinyes (1 commits)")[![xuanyanwow](https://avatars.githubusercontent.com/u/28777109?v=4)](https://github.com/xuanyanwow "xuanyanwow (1 commits)")[![tioncico](https://avatars.githubusercontent.com/u/31308307?v=4)](https://github.com/tioncico "tioncico (1 commits)")[![kajweb](https://avatars.githubusercontent.com/u/2993320?v=4)](https://github.com/kajweb "kajweb (1 commits)")[![liosmt0](https://avatars.githubusercontent.com/u/43941983?v=4)](https://github.com/liosmt0 "liosmt0 (1 commits)")[![Player626](https://avatars.githubusercontent.com/u/44792981?v=4)](https://github.com/Player626 "Player626 (1 commits)")[![RunsTp](https://avatars.githubusercontent.com/u/28254581?v=4)](https://github.com/RunsTp "RunsTp (1 commits)")

---

Tags

asyncframeworkswooleeasyswoole

### Embed Badge

![Health badge](/badges/wangrunxinyes-easyswoole-component/health.svg)

```
[![Health](https://phpackages.com/badges/wangrunxinyes-easyswoole-component/health.svg)](https://phpackages.com/packages/wangrunxinyes-easyswoole-component)
```

###  Alternatives

[easyswoole/easyswoole

An efficient swoole framework

4.8k186.9k50](/packages/easyswoole-easyswoole)[easyswoole/rpc

An efficient swoole framework

7731.6k2](/packages/easyswoole-rpc)[easyswoole/mysqli

An efficient swoole framework

34120.5k27](/packages/easyswoole-mysqli)[easyswoole/redis

easyswoole component

3391.8k12](/packages/easyswoole-redis)[easyswoole/compiler

easyswoole component

691.1k](/packages/easyswoole-compiler)[easyswoole/actor

easyswoole component

1410.3k](/packages/easyswoole-actor)

PHPackages © 2026

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