library swoft-trait-instance
基于Swoft的协程单例扩展
limingxinleo/swoft-trait-instance
基于Swoft的协程单例扩展
- Thursday, June 28, 2018
- by limingxinleo
- Repository
- 1 Watchers
- 2 Stars
- 407 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
swoft-trait-instance
基于Swoft的协程单例扩展, (*1)
, (*2)
单例模式Trait
<?php
use Xin\Swoft\Traits\InstanceTrait;
class Incr
{
use InstanceTrait;
public $incr = 0;
public function incr()
{
return ++$this->incr;
}
public function get()
{
return $this->incr;
}
}
echo Incr::getInstance()->incr(); // 1
go(function(){
echo Incr::getInstance()->incr(); // 1
});
dev-master
9999999-dev
基于Swoft的协程单例扩展
Sources
Download
MIT
The Requires
The Development Requires
by
李铭昕
php
swoole
instance
swoft
1.0.0
1.0.0.0
基于Swoft的协程单例扩展
Sources
Download
MIT
The Requires
The Development Requires
by
李铭昕
php
swoole
instance
swoft