From 1a5be575fbb2cd51b234d29a154c8abe4b00efbc Mon Sep 17 00:00:00 2001 From: chaz6chez Date: Wed, 2 Oct 2024 22:23:46 +0800 Subject: [PATCH] doc update --- ...ny-WebmanCoroutine-CoroutineWebServer.html | 24 +- ...ny-WebmanCoroutine-Events-SwooleEvent.html | 32 +- .../Workbunny-WebmanCoroutine-Factory.html | 319 +++------------ ...bmanCoroutine-Handlers-DefaultHandler.html | 353 +---------------- ...anCoroutine-Handlers-HandlerInterface.html | 357 +---------------- ...ebmanCoroutine-Handlers-RippleHandler.html | 371 +----------------- ...ebmanCoroutine-Handlers-SwooleHandler.html | 351 +---------------- ...tine-Handlers-SwooleWorkerman5Handler.html | 343 +--------------- ...-WebmanCoroutine-Handlers-SwowHandler.html | 351 +---------------- ...outine-Handlers-SwowWorkerman5Handler.html | 343 +--------------- ...WebmanCoroutine-Utils-Channel-Channel.html | 56 ++- ...Utils-Channel-Handlers-DefaultChannel.html | 20 +- ...-Utils-Channel-Handlers-RippleChannel.html | 38 +- ...-Utils-Channel-Handlers-SwooleChannel.html | 20 +- ...ne-Utils-Channel-Handlers-SwowChannel.html | 20 +- ...anCoroutine-Utils-Coroutine-Coroutine.html | 98 ++--- ...Coroutine-Handlers-CoroutineInterface.html | 122 ++---- ...s-Coroutine-Handlers-DefaultCoroutine.html | 144 ++----- ...ls-Coroutine-Handlers-RippleCoroutine.html | 152 ++----- ...ls-Coroutine-Handlers-SwooleCoroutine.html | 148 ++----- ...tils-Coroutine-Handlers-SwowCoroutine.html | 148 ++----- ...ls-WaitGroup-Handlers-RippleWaitGroup.html | 16 +- ...ls-WaitGroup-Handlers-SwooleWaitGroup.html | 28 +- ...tils-WaitGroup-Handlers-SwowWaitGroup.html | 16 +- ...anCoroutine-Utils-WaitGroup-WaitGroup.html | 56 ++- ...Coroutine-Utils-Worker-AbstractWorker.html | 117 +----- ...y-WebmanCoroutine-Utils-Worker-Server.html | 149 +------ ...nCoroutine-Utils-Worker-ServerMethods.html | 40 +- ...y-WebmanCoroutine-Utils-Worker-Worker.html | 121 +----- ...nCoroutine-Utils-Worker-WorkerMethods.html | 12 +- docs/files/src-helpers.html | 4 +- docs/files/src-utils-tools.html | 4 +- docs/files/src/CoroutineWebServer.php.txt | 28 +- docs/files/src/Events/SwooleEvent.php.txt | 7 + docs/files/src/Factory.php.txt | 116 ++---- .../files/src/Handlers/DefaultHandler.php.txt | 48 +-- .../src/Handlers/HandlerInterface.php.txt | 52 +-- docs/files/src/Handlers/RippleHandler.php.txt | 100 +---- docs/files/src/Handlers/SwooleHandler.php.txt | 177 +-------- docs/files/src/Handlers/SwowHandler.php.txt | 154 +------- docs/files/src/Utils/Channel/Channel.php.txt | 12 +- .../Channel/Handlers/DefaultChannel.php.txt | 18 +- .../Channel/Handlers/RippleChannel.php.txt | 55 ++- .../Channel/Handlers/SwooleChannel.php.txt | 21 +- .../Channel/Handlers/SwowChannel.php.txt | 21 +- .../src/Utils/Coroutine/Coroutine.php.txt | 20 +- .../Handlers/CoroutineInterface.php.txt | 21 +- .../Handlers/DefaultCoroutine.php.txt | 14 +- .../Handlers/RippleCoroutine.php.txt | 35 +- .../Handlers/SwooleCoroutine.php.txt | 34 +- .../Coroutine/Handlers/SwowCoroutine.php.txt | 25 +- .../Handlers/RippleWaitGroup.php.txt | 12 +- .../Handlers/SwooleWaitGroup.php.txt | 37 +- .../WaitGroup/Handlers/SwowWaitGroup.php.txt | 16 +- .../src/Utils/WaitGroup/WaitGroup.php.txt | 12 +- .../src/Utils/Worker/AbstractWorker.php.txt | 38 +- .../src/Utils/Worker/ServerMethods.php.txt | 10 +- .../src/Utils/Worker/WorkerMethods.php.txt | 5 +- docs/files/src/Utils/tools.php.txt | 2 + docs/files/src/helpers.php.txt | 7 +- docs/index.html | 4 +- docs/indices/files.html | 4 - docs/js/searchIndex.js | 329 ++++------------ docs/namespaces/default.html | 4 +- .../namespaces/workbunny-webmancoroutine.html | 24 +- docs/packages/WebmanCoroutine.html | 12 +- 66 files changed, 977 insertions(+), 4870 deletions(-) diff --git a/docs/classes/Workbunny-WebmanCoroutine-CoroutineWebServer.html b/docs/classes/Workbunny-WebmanCoroutine-CoroutineWebServer.html index bfaf977..7b7e6df 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-CoroutineWebServer.html +++ b/docs/classes/Workbunny-WebmanCoroutine-CoroutineWebServer.html @@ -121,9 +121,9 @@

协程化web服务进程

@@ -218,9 +218,9 @@

连接关闭

@@ -275,9 +275,9 @@

连接建立

@@ -332,9 +332,9 @@

@@ -416,9 +416,9 @@

@@ -475,9 +475,9 @@

停止服务

diff --git a/docs/classes/Workbunny-WebmanCoroutine-Events-SwooleEvent.html b/docs/classes/Workbunny-WebmanCoroutine-Events-SwooleEvent.html index 9088990..5820ed3 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Events-SwooleEvent.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Events-SwooleEvent.html @@ -122,9 +122,9 @@

@@ -234,9 +234,9 @@

@@ -298,9 +298,9 @@

@@ -378,9 +378,9 @@

@@ -427,9 +427,9 @@

@@ -493,9 +493,9 @@

@@ -542,9 +542,9 @@

@@ -591,9 +591,9 @@

diff --git a/docs/classes/Workbunny-WebmanCoroutine-Factory.html b/docs/classes/Workbunny-WebmanCoroutine-Factory.html index 42b576e..3b828f2 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Factory.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Factory.html @@ -118,9 +118,9 @@

工厂化启动器

@@ -197,17 +197,10 @@

-
- find() - -  : string -
-
根据当前环境获取可用的处理器
-
get() -  : string +  : string|null
根据事件循环类获取对应处理器
@@ -223,6 +216,7 @@

 : string|null +
获取当前事件循环
getCurrentHandler() @@ -245,20 +239,6 @@

注册事件处理器
-
- run() - -  : mixed -
-
根据当前环境运行处理器
- -
- start() - -  : mixed -
-
根据当前环境运行处理器
-
unregister() @@ -287,9 +267,9 @@

@@ -319,9 +299,9 @@

@@ -351,9 +331,9 @@

@@ -383,9 +363,9 @@

@@ -415,9 +395,9 @@

@@ -447,9 +427,9 @@

@@ -484,62 +464,6 @@

-method -public -static " -> -

- find() - - -

- - -

根据当前环境获取可用的处理器

- - - public - static find([bool $returnEventLoopClass = false ]) : string - -
-
- - -
Parameters
-
-
- $returnEventLoopClass - : bool - = false
-
-

是否返回事件循环类名

-
- -
-
- - - - - -
-
Return values
- string - — -

事件循环类名|处理器类名|空字符串

-
- -
- - -

get() @@ -549,16 +473,16 @@

根据事件循环类获取对应处理器

public - static get(string $eventLoopClass[, bool $available = false ][, bool $returnEventLoopClass = false ]) : string + static get(null|string $eventLoopClass) : string|null
@@ -568,30 +492,12 @@

Parameters
$eventLoopClass - : string + : null|string

指定的事件循环类

-
-
- $available - : bool - = false
-
-

是否校验当前环境可用性

-
- -
-
- $returnEventLoopClass - : bool - = false
-
-

只在available=true时生效

-
-
@@ -601,7 +507,11 @@
Parameters
Return values
- string + string|null + — +

null:未找到

+
+
@@ -619,9 +529,9 @@

获取所有事件处理器

@@ -659,12 +569,13 @@

- +

获取当前事件循环

+ public static getCurrentEventLoop() : string|null @@ -681,6 +592,10 @@

Return values
string|null + — +

null:未初始化 空字符串:默认事件

+
+
@@ -698,9 +613,9 @@

获取当前使用的处理器类名

@@ -721,6 +636,10 @@

Return values
string|null + — +

null:未初始化

+
+
@@ -738,9 +657,9 @@

初始化

@@ -784,9 +703,9 @@

注册事件处理器

@@ -834,147 +753,6 @@

Return values
- -
-

- run() - - -

- - -

根据当前环境运行处理器

- - - public - static run(CoroutineServerInterface $app, mixed|ConnectionInterface $connection, mixed|Request $request[, string|null $eventLoopClass = null ]) : mixed - -
-
- - -
Parameters
-
-
- $app - : CoroutineServerInterface -
-
-

实现CoroutineServerInterface

-
- -
-
- $connection - : mixed|ConnectionInterface -
-
-

连接资源

-
- -
-
- $request - : mixed|Request -
-
-

请求体

-
- -
-
- $eventLoopClass - : string|null - = null
-
-

null:根据环境获取事件循环类

-
- -
-
- - - - - - -
-
-

- start() - - -

- - -

根据当前环境运行处理器

- - - public - static start(CoroutineWorkerInterface $app[, mixed|Worker|null $worker = null ][, string|null $eventLoopClass = null ]) : mixed - -
-
- - -
Parameters
-
-
- $app - : CoroutineWorkerInterface -
-
-

实现CoroutineWorkerInterface

-
- -
-
- $worker - : mixed|Worker|null - = null
-
-

worker对象

-
- -
-
- $eventLoopClass - : string|null - = null
-
-

null:根据环境获取事件循环类

-
- -
-
- - - - - -

注销事件处理器

@@ -1157,15 +935,12 @@
Return values
  • Methods
  • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Handlers-DefaultHandler.html b/docs/classes/Workbunny-WebmanCoroutine-Handlers-DefaultHandler.html index b227b01..1507217 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Handlers-DefaultHandler.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Handlers-DefaultHandler.html @@ -122,9 +122,9 @@

    默认处理器,使用workerman基础事件

    @@ -166,11 +166,11 @@

    - coroutineCreate() + initEnv() -  : mixed +  : void
    -
    default handler不会创建协程
    +
    default handler无需初始化
    isAvailable() @@ -179,34 +179,6 @@

    default handler永远返回true
    -
    - onMessage() - -  : mixed -
    -
    default handler不会创建协程
    - -
    - onWorkerStart() - -  : mixed -
    -
    default handler不会创建协程
    - -
    - waitGroupCreate() - -  : string -
    -
    default handler不会创建waitGroup
    - -
    - waitGroupWait() - -  : void -
    -
    default handler不会等待waitGroup
    -
    @@ -227,55 +199,34 @@

    -public -static " > -

    - coroutineCreate() - +

    + initEnv() +

    -

    default handler不会创建协程

    +

    default handler无需初始化

    public - static coroutineCreate(Closure $function[, string|null $waitGroupId = null ]) : mixed + static initEnv() : void
    -
    Parameters
    -
    -
    - $function - : Closure -
    -
    -

    协程执行逻辑

    -
    - -
    -
    - $waitGroupId - : string|null - = null
    -
    -

    null:不使用waitGroup

    -
    - -
    -
    - +
    Tags - +
    @@ -306,9 +257,9 @@

    default handler永远返回true

    @@ -349,272 +300,6 @@

    Return values
    -
    -
    -

    - onMessage() - - -

    - - -

    default handler不会创建协程

    - - - public - static onMessage(CoroutineServerInterface $app, mixed $connection, mixed $request) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineServerInterface -
    -
    - -
    -
    - $connection - : mixed -
    -
    - -
    -
    - $request - : mixed -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - - -
    -
    -

    - onWorkerStart() - - -

    - - -

    default handler不会创建协程

    - - - public - static onWorkerStart(CoroutineWorkerInterface $app, mixed $worker) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineWorkerInterface -
    -
    - -
    -
    - $worker - : mixed -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - - -
    -
    -

    - waitGroupCreate() - - -

    - - -

    default handler不会创建waitGroup

    - - - public - static waitGroupCreate() : string - -
    -
    - - - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    -
    Return values
    - string - — -

    返回waitGroupId

    -
    - -
    - -
    -
    -

    - waitGroupWait() - - -

    - - -

    default handler不会等待waitGroup

    - - - public - static waitGroupWait(string $waitGroupId[, int $timeout = -1 ]) : void - -
    -
    - - -
    Parameters
    -
    -
    - $waitGroupId - : string -
    -
    - -
    -
    - $timeout - : int - = -1
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    @@ -729,12 +414,8 @@
  • Methods
  • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Handlers-HandlerInterface.html b/docs/classes/Workbunny-WebmanCoroutine-Handlers-HandlerInterface.html index f198526..ab7b909 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Handlers-HandlerInterface.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Handlers-HandlerInterface.html @@ -110,9 +110,9 @@

    协程处理器接口

    @@ -147,11 +147,11 @@

    - coroutineCreate() + initEnv() -  : mixed +  : void
    -
    创建一个协程
    +
    用于环境加载初始化
    isAvailable() @@ -160,34 +160,6 @@

    用于判断当前环境是否可用
    -
    - onMessage() - -  : mixed -
    -
    执行协程处理
    - -
    - onWorkerStart() - -  : mixed -
    -
    执行协程处理
    - -
    - waitGroupCreate() - -  : string -
    -
    创建一个waitGroup
    - -
    - waitGroupWait() - -  : void -
    -
    阻塞等待一个waitGroup完成
    -
    @@ -207,67 +179,31 @@

    -public -static " > -

    - coroutineCreate() - +

    + initEnv() +

    -

    创建一个协程

    +

    用于环境加载初始化

    public - static coroutineCreate(Closure $function[, string|null $waitGroupId = null ]) : mixed + static initEnv() : void
    -
    Parameters
    -
    -
    - $function - : Closure -
    -
    -

    协程执行逻辑

    -
    - -
    -
    - $waitGroupId - : string|null - = null
    -
    -

    null:不使用waitGroup

    -
    - -
    -
    - -
    - Tags - - -
    -
    -
    - throws -
    -
    - RuntimeException - - -
    -
    + @@ -287,9 +223,9 @@

    用于判断当前环境是否可用

    @@ -316,263 +252,6 @@

    Return values
    - -
    -

    - onMessage() - - -

    - - -

    执行协程处理

    - - - public - static onMessage(CoroutineServerInterface $app, mixed|ConnectionInterface $connection, mixed|Request $request) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineServerInterface -
    -
    - -
    -
    - $connection - : mixed|ConnectionInterface -
    -
    - -
    -
    - $request - : mixed|Request -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - throws -
    -
    - RuntimeException - - -
    -
    - - - - -
    - -
    -

    - waitGroupCreate() - - -

    - - -

    创建一个waitGroup

    - - - public - static waitGroupCreate() : string - -
    -
    - - - - - - - -
    -
    Return values
    - string - — -

    返回waitGroupId

    -
    - -
    - -
    -
    -

    - waitGroupWait() - - -

    - - -

    阻塞等待一个waitGroup完成

    - - - public - static waitGroupWait(string $waitGroupId[, int $timeout = -1 ]) : void - -
    -
    - - -
    Parameters
    -
    -
    - $waitGroupId - : string -
    -
    - -
    -
    - $timeout - : int - = -1
    -
    -

    默认无超时时间

    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - throws -
    -
    - RuntimeException - - -
    -
    - - - -
    @@ -686,12 +365,8 @@
  • Methods
  • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Handlers-RippleHandler.html b/docs/classes/Workbunny-WebmanCoroutine-Handlers-RippleHandler.html index b7f47dd..3c11546 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Handlers-RippleHandler.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Handlers-RippleHandler.html @@ -122,9 +122,9 @@

    基于Ripple插件的协程处理器,支持PHP-fiber

    @@ -166,11 +166,11 @@

    - coroutineCreate() + initEnv() -  : Promise +  : void
    -
    创建一个协程
    +
    ripple handler无需初始化
    isAvailable() @@ -179,34 +179,6 @@

    用于判断当前环境是否可用
    -
    - onMessage() - -  : mixed -
    -
    执行协程处理
    - -
    - onWorkerStart() - -  : mixed -
    -
    执行协程处理
    - -
    - waitGroupCreate() - -  : string -
    -
    创建一个waitGroup
    - -
    - waitGroupWait() - -  : void -
    -
    阻塞等待一个waitGroup完成
    -
    @@ -227,51 +199,34 @@

    -public -static " > -

    - coroutineCreate() - +

    + initEnv() +

    -

    创建一个协程

    +

    ripple handler无需初始化

    public - static coroutineCreate(Closure $function[, string|null $waitGroupId = null ]) : Promise + static initEnv() : void
    -
    Parameters
    -
    -
    - $function - : Closure -
    -
    - -
    -
    - $waitGroupId - : string|null - = null
    -
    - -
    -
    - +
    Tags - +
    @@ -281,26 +236,12 @@
    -
    -
    - throws -
    -
    - HandlerException - -

    使用一个不存在的waitGroupId会抛出异常

    -
    -
    -
    -
    Return values
    - Promise -
    - +

    用于判断当前环境是否可用

    @@ -359,278 +300,6 @@
    Return values
    -
    -
    -

    - onMessage() - - -

    - - -

    执行协程处理

    - - - public - static onMessage(CoroutineServerInterface $app, mixed $connection, mixed $request) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineServerInterface -
    -
    - -
    -
    - $connection - : mixed -
    -
    - -
    -
    - $request - : mixed -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - - -
    -
    -

    - onWorkerStart() - - -

    - - -

    执行协程处理

    - - - public - static onWorkerStart(CoroutineWorkerInterface $app, mixed $worker) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineWorkerInterface -
    -
    - -
    -
    - $worker - : mixed -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - - -
    -
    -

    - waitGroupCreate() - - -

    - - -

    创建一个waitGroup

    - - - public - static waitGroupCreate() : string - -
    -
    - - - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    -
    Return values
    - string -
    - -
    -
    -

    - waitGroupWait() - - -

    - - -

    阻塞等待一个waitGroup完成

    - - - public - static waitGroupWait(string $waitGroupId[, int $timeout = -1 ]) : void - -
    -
    - - -
    Parameters
    -
    -
    - $waitGroupId - : string -
    -
    - -
    -
    - $timeout - : int - = -1
    -
    -

    ripple不生效

    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - throws -
    -
    - Throwable - - -
    -
    - - - -
    @@ -745,12 +414,8 @@
  • Methods
  • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwooleHandler.html b/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwooleHandler.html index 5838a2a..edf4183 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwooleHandler.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwooleHandler.html @@ -122,9 +122,9 @@

    基于swoole实现的协程处理器

    @@ -166,11 +166,11 @@

    - coroutineCreate() + initEnv() -  : int|bool +  : void
    -
    创建一个协程
    +
    用于环境加载初始化
    isAvailable() @@ -179,34 +179,6 @@

    用于判断当前环境是否可用
    -
    - onMessage() - -  : mixed -
    -
    执行协程处理
    - -
    - onWorkerStart() - -  : mixed -
    -
    执行协程处理
    - -
    - waitGroupCreate() - -  : string -
    -
    创建一个waitGroup
    - -
    - waitGroupWait() - -  : void -
    -
    阻塞等待一个waitGroup完成
    -
    @@ -227,51 +199,34 @@

    -public -static " > -

    - coroutineCreate() - +

    + initEnv() +

    -

    创建一个协程

    +

    用于环境加载初始化

    public - static coroutineCreate(Closure $function[, string|null $waitGroupId = null ]) : int|bool + static initEnv() : void
    -
    Parameters
    -
    -
    - $function - : Closure -
    -
    - -
    -
    - $waitGroupId - : string|null - = null
    -
    - -
    -
    - +
    Tags - +
    @@ -286,11 +241,7 @@
    -
    -
    Return values
    - int|bool -
    - +

    用于判断当前环境是否可用

    @@ -349,268 +300,6 @@
    Return values
    -
    -
    -

    - onMessage() - - -

    - - -

    执行协程处理

    - - - public - static onMessage(CoroutineServerInterface $app, mixed $connection, mixed $request) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineServerInterface -
    -
    - -
    -
    - $connection - : mixed -
    -
    - -
    -
    - $request - : mixed -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - - -
    -
    -

    - onWorkerStart() - - -

    - - -

    执行协程处理

    - - - public - static onWorkerStart(CoroutineWorkerInterface $app, mixed $worker) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineWorkerInterface -
    -
    - -
    -
    - $worker - : mixed -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - - -
    -
    -

    - waitGroupCreate() - - -

    - - -

    创建一个waitGroup

    - - - public - static waitGroupCreate() : string - -
    -
    - - - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    -
    Return values
    - string -
    - -
    -
    -

    - waitGroupWait() - - -

    - - -

    阻塞等待一个waitGroup完成

    - - - public - static waitGroupWait(string $waitGroupId[, int $timeout = -1 ]) : void - -
    -
    - - -
    Parameters
    -
    -
    - $waitGroupId - : string -
    -
    - -
    -
    - $timeout - : int - = -1
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    @@ -725,12 +414,8 @@
  • Methods
  • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwooleWorkerman5Handler.html b/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwooleWorkerman5Handler.html index d3d9167..a510312 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwooleWorkerman5Handler.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwooleWorkerman5Handler.html @@ -159,11 +159,11 @@

    - coroutineCreate() + initEnv() -  : int|bool +  : void
    -
    创建一个协程
    +
    用于环境加载初始化
    isAvailable() @@ -172,34 +172,6 @@

    用于判断当前环境是否可用
    -
    - onMessage() - -  : mixed -
    -
    执行协程处理
    - -
    - onWorkerStart() - -  : mixed -
    -
    执行协程处理
    - -
    - waitGroupCreate() - -  : string -
    -
    创建一个waitGroup
    - -
    - waitGroupWait() - -  : void -
    -
    阻塞等待一个waitGroup完成
    -
    @@ -220,51 +192,34 @@

    -public -static " > -

    - coroutineCreate() - +

    + initEnv() +

    -

    创建一个协程

    +

    用于环境加载初始化

    public - static coroutineCreate(Closure $function[, string|null $waitGroupId = null ]) : int|bool + static initEnv() : void
    -
    Parameters
    -
    -
    - $function - : Closure -
    -
    - -
    -
    - $waitGroupId - : string|null - = null
    -
    - -
    -
    - +
    Tags - +
    @@ -279,11 +234,7 @@
    -
    -
    Return values
    - int|bool -
    - +
    Return values
    - -
    -

    - onMessage() - - -

    - - -

    执行协程处理

    - - - public - static onMessage(CoroutineServerInterface $app, mixed $connection, mixed $request) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineServerInterface -
    -
    - -
    -
    - $connection - : mixed -
    -
    - -
    -
    - $request - : mixed -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - - -
    -
    -

    - onWorkerStart() - - -

    - - -

    执行协程处理

    - - - public - static onWorkerStart(CoroutineWorkerInterface $app, mixed $worker) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineWorkerInterface -
    -
    - -
    -
    - $worker - : mixed -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - - -
    -
    -

    - waitGroupCreate() - - -

    - - -

    创建一个waitGroup

    - - - public - static waitGroupCreate() : string - -
    -
    - - - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    -
    Return values
    - string -
    - -
    -
    -

    - waitGroupWait() - - -

    - - -

    阻塞等待一个waitGroup完成

    - - - public - static waitGroupWait(string $waitGroupId[, int $timeout = -1 ]) : void - -
    -
    - - -
    Parameters
    -
    -
    - $waitGroupId - : string -
    -
    - -
    -
    - $timeout - : int - = -1
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    @@ -718,12 +407,8 @@
  • Methods
  • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwowHandler.html b/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwowHandler.html index ceeba3a..9ac820a 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwowHandler.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwowHandler.html @@ -122,9 +122,9 @@

    基于swow实现的协程处理器

    @@ -166,11 +166,11 @@

    - coroutineCreate() + initEnv() -  : Coroutine +  : void
    -
    创建一个协程
    +
    swow handler无需初始化
    isAvailable() @@ -179,34 +179,6 @@

    用于判断当前环境是否可用
    -
    - onMessage() - -  : mixed -
    -
    执行协程处理
    - -
    - onWorkerStart() - -  : mixed -
    -
    执行协程处理
    - -
    - waitGroupCreate() - -  : string -
    -
    创建一个waitGroup
    - -
    - waitGroupWait() - -  : void -
    -
    阻塞等待一个waitGroup完成
    -
    @@ -227,51 +199,34 @@

    -public -static " > -

    - coroutineCreate() - +

    + initEnv() +

    -

    创建一个协程

    +

    swow handler无需初始化

    public - static coroutineCreate(Closure $function[, string|null $waitGroupId = null ]) : Coroutine + static initEnv() : void
    -
    Parameters
    -
    -
    - $function - : Closure -
    -
    - -
    -
    - $waitGroupId - : string|null - = null
    -
    - -
    -
    - +
    Tags - +
    @@ -286,11 +241,7 @@
    -
    -
    Return values
    - Coroutine -
    - +

    用于判断当前环境是否可用

    @@ -349,268 +300,6 @@
    Return values
    -
    -
    -

    - onMessage() - - -

    - - -

    执行协程处理

    - - - public - static onMessage(CoroutineServerInterface $app, mixed $connection, mixed $request) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineServerInterface -
    -
    - -
    -
    - $connection - : mixed -
    -
    - -
    -
    - $request - : mixed -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - - -
    -
    -

    - onWorkerStart() - - -

    - - -

    执行协程处理

    - - - public - static onWorkerStart(CoroutineWorkerInterface $app, mixed $worker) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineWorkerInterface -
    -
    - -
    -
    - $worker - : mixed -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - - -
    -
    -

    - waitGroupCreate() - - -

    - - -

    创建一个waitGroup

    - - - public - static waitGroupCreate() : string - -
    -
    - - - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    -
    Return values
    - string -
    - -
    -
    -

    - waitGroupWait() - - -

    - - -

    阻塞等待一个waitGroup完成

    - - - public - static waitGroupWait(string $waitGroupId[, int $timeout = -1 ]) : void - -
    -
    - - -
    Parameters
    -
    -
    - $waitGroupId - : string -
    -
    - -
    -
    - $timeout - : int - = -1
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    @@ -725,12 +414,8 @@
  • Methods
  • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwowWorkerman5Handler.html b/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwowWorkerman5Handler.html index 32817d0..69874b4 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwowWorkerman5Handler.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Handlers-SwowWorkerman5Handler.html @@ -159,11 +159,11 @@

    - coroutineCreate() + initEnv() -  : Coroutine +  : void
    -
    创建一个协程
    +
    swow handler无需初始化
    isAvailable() @@ -172,34 +172,6 @@

    用于判断当前环境是否可用
    -
    - onMessage() - -  : mixed -
    -
    执行协程处理
    - -
    - onWorkerStart() - -  : mixed -
    -
    执行协程处理
    - -
    - waitGroupCreate() - -  : string -
    -
    创建一个waitGroup
    - -
    - waitGroupWait() - -  : void -
    -
    阻塞等待一个waitGroup完成
    -
    @@ -220,51 +192,34 @@

    -public -static " > -

    - coroutineCreate() - +

    + initEnv() +

    -

    创建一个协程

    +

    swow handler无需初始化

    public - static coroutineCreate(Closure $function[, string|null $waitGroupId = null ]) : Coroutine + static initEnv() : void
    -
    Parameters
    -
    -
    - $function - : Closure -
    -
    - -
    -
    - $waitGroupId - : string|null - = null
    -
    - -
    -
    - +
    Tags - +
    @@ -279,11 +234,7 @@
    -
    -
    Return values
    - Coroutine -
    - +
    Return values
    - -
    -

    - onMessage() - - -

    - - -

    执行协程处理

    - - - public - static onMessage(CoroutineServerInterface $app, mixed $connection, mixed $request) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineServerInterface -
    -
    - -
    -
    - $connection - : mixed -
    -
    - -
    -
    - $request - : mixed -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - - -
    -
    -

    - onWorkerStart() - - -

    - - -

    执行协程处理

    - - - public - static onWorkerStart(CoroutineWorkerInterface $app, mixed $worker) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $app - : CoroutineWorkerInterface -
    -
    - -
    -
    - $worker - : mixed -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - - -
    -
    -

    - waitGroupCreate() - - -

    - - -

    创建一个waitGroup

    - - - public - static waitGroupCreate() : string - -
    -
    - - - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    -
    Return values
    - string -
    - -
    -
    -

    - waitGroupWait() - - -

    - - -

    阻塞等待一个waitGroup完成

    - - - public - static waitGroupWait(string $waitGroupId[, int $timeout = -1 ]) : void - -
    -
    - - -
    Parameters
    -
    -
    - $waitGroupId - : string -
    -
    - -
    -
    - $timeout - : int - = -1
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    @@ -718,12 +407,8 @@
  • Methods
  • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Channel.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Channel.html index cf6a8c6..dd87b72 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Channel.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Channel.html @@ -172,6 +172,13 @@

    构造方法
    +
    + __destruct() + +  : mixed +
    +
    析构方法
    +
    capacity() @@ -269,9 +276,9 @@

    代理调用ChannelInterface方法

    @@ -353,6 +360,42 @@

    Parameters
    + +
    +

    + __destruct() + + +

    + + +

    析构方法

    + + + public + __destruct() : mixed + +
    +
    + + + + + + + +
    @@ -837,9 +880,9 @@

    @@ -1001,6 +1044,7 @@

    Return values
    • __call()
    • __construct()
    • +
    • __destruct()
    • capacity()
    • close()
    • getHandler()
    • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-DefaultChannel.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-DefaultChannel.html index 79dffe8..1ae9716 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-DefaultChannel.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-DefaultChannel.html @@ -362,9 +362,9 @@

      获取通道容量

      @@ -416,9 +416,9 @@

      关闭通道

      @@ -466,9 +466,9 @@

      通道是否为空

      @@ -520,9 +520,9 @@

      通道是否满

      @@ -628,9 +628,9 @@

      推送一个数据

      diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-RippleChannel.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-RippleChannel.html index 66fe280..456261e 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-RippleChannel.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-RippleChannel.html @@ -362,9 +362,9 @@

      获取通道容量

      @@ -416,9 +416,9 @@

      关闭通道

      @@ -466,9 +466,9 @@

      通道是否为空

      @@ -520,9 +520,9 @@

      通道是否满

      @@ -574,9 +574,9 @@

      获取一个数据

      @@ -601,6 +601,20 @@

      Parameters

    +
    + Tags + + +
    +
    +
    + inheritdoc +
    +
    + + +
    +
    @@ -628,9 +642,9 @@

    推送一个数据

    diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-SwooleChannel.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-SwooleChannel.html index 458cb0c..5a9ebdf 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-SwooleChannel.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-SwooleChannel.html @@ -362,9 +362,9 @@

    获取通道容量

    @@ -416,9 +416,9 @@

    关闭通道

    @@ -466,9 +466,9 @@

    通道是否为空

    @@ -520,9 +520,9 @@

    通道是否满

    @@ -642,9 +642,9 @@

    推送一个数据

    diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-SwowChannel.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-SwowChannel.html index 0c868a9..933d640 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-SwowChannel.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Channel-Handlers-SwowChannel.html @@ -362,9 +362,9 @@

    获取通道容量

    @@ -416,9 +416,9 @@

    关闭通道

    @@ -466,9 +466,9 @@

    通道是否为空

    @@ -520,9 +520,9 @@

    通道是否满

    @@ -642,9 +642,9 @@

    推送一个数据

    diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Coroutine.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Coroutine.html index 4b71b05..c56552c 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Coroutine.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Coroutine.html @@ -123,9 +123,9 @@

    @@ -170,12 +170,11 @@

     : mixed -
    构造方法
    - create() + __destruct() -  : string +  : mixed
    @@ -186,7 +185,7 @@

    获取指定handler 或 获取所有
    - query() + origin()  : mixed
    @@ -245,9 +244,9 @@

    代理调用WaitGroupInterface方法

    @@ -298,22 +297,31 @@

    -

    构造方法

    - + public - __construct() : mixed + __construct(Closure $func) : mixed
    - +

    Parameters
    +
    +
    + $func + : Closure +
    +
    + +
    +
    + @@ -326,48 +334,34 @@

    -public " > -

    - create() - +

    + __destruct() +

    public - create([Closure $func = ]) : string + __destruct() : mixed
    -
    Parameters
    -
    -
    - $func - : Closure - =
    -
    - -
    -
    - - -
    -
    Return values
    - string -
    + +
    Return values

    -public " > -

    - query() - +

    + origin() +

    -

    初始化

    +

    创建协程

    public - __construct() : mixed + __construct(Closure $func) : mixed
    - +
    Parameters
    +
    +
    + $func + : Closure +
    +
    + +
    +
    + @@ -243,7 +246,7 @@

    -

    销毁

    +

    销毁协程

    public @@ -266,107 +269,35 @@

    -public " > -

    - create() - +

    + origin() +

    -

    创建一个协程

    +

    获取协程原始返回

    public - create(Closure $func) : string + origin() : mixed
    -

    Parameters
    -
    -
    - $func - : Closure -
    -
    - -
    -
    - - -
    -
    Return values
    - string - — -

    协程id

    -
    - -
    - - -
    -

    - query() - - -

    - - -

    获取协程对象,部分实现不支持

    - - - public - query(string $id) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $id - : string -
    -
    - -
    -
    - - -
    -
    Return values
    - mixed - — -

    null:不存在 false:不支持

    -
    - -
    -
    @@ -482,8 +413,7 @@
    Return values
    diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-DefaultCoroutine.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-DefaultCoroutine.html index f0302cd..2825266 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-DefaultCoroutine.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-DefaultCoroutine.html @@ -171,28 +171,21 @@

     : mixed -
    初始化
    +
    创建协程
    __destruct()  : mixed
    -
    销毁
    +
    销毁协程
    - create() - -  : string -
    -
    创建一个协程
    - -
    - query() + origin()  : mixed
    -
    获取协程对象,部分实现不支持
    +
    获取协程原始返回
    @@ -227,17 +220,27 @@

    -

    初始化

    +

    创建协程

    public - __construct() : mixed + __construct(Closure $func) : mixed
    - +

    Parameters
    +
    +
    + $func + : Closure +
    +
    + +
    +
    +
    Tags @@ -272,12 +275,12 @@

    -

    销毁

    +

    销毁协程

    public @@ -314,112 +317,34 @@
    -public " > -

    - create() - +

    + origin() +

    -

    创建一个协程

    +

    获取协程原始返回

    public - create(Closure $func) : string + origin() : mixed
    -

    Parameters
    -
    -
    - $func - : Closure -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    -
    Return values
    - string - — -

    协程id

    -
    - -
    - - -
    -

    - query() - - -

    - - -

    获取协程对象,部分实现不支持

    - - - public - query(string $id) : mixed - -
    -
    - -
    Parameters
    -
    -
    - $id - : string -
    -
    - -
    -
    -
    Tags - +
    @@ -434,15 +359,7 @@
    -
    -
    Return values
    - mixed - — -

    null:不存在 false:不支持

    -
    - -
    - +
    @@ -559,8 +476,7 @@
    Return values
    diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-RippleCoroutine.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-RippleCoroutine.html index d1cce6f..aa0a631 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-RippleCoroutine.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-RippleCoroutine.html @@ -124,9 +124,9 @@

    @@ -171,28 +171,21 @@

     : mixed -
    初始化
    +
    创建协程
    __destruct()  : mixed
    -
    销毁
    +
    销毁协程
    - create() - -  : string -
    -
    创建一个协程
    - -
    - query() + origin()  : mixed
    -
    获取协程对象,部分实现不支持
    +
    获取协程原始返回
    @@ -222,22 +215,32 @@

    -

    初始化

    +

    创建协程

    public - __construct() : mixed + __construct(Closure $func) : mixed
    - +

    Parameters
    +
    +
    + $func + : Closure +
    +
    + +
    +
    +
    Tags @@ -272,12 +275,12 @@

    -

    销毁

    +

    销毁协程

    public @@ -314,112 +317,34 @@
    -public " > -

    - create() - +

    + origin() +

    -

    创建一个协程

    +

    获取协程原始返回

    public - create(Closure $func) : string + origin() : mixed
    -

    Parameters
    -
    -
    - $func - : Closure -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    -
    Return values
    - string - — -

    协程id

    -
    - -
    - - -
    -

    - query() - - -

    - - -

    获取协程对象,部分实现不支持

    - - - public - query(string $id) : mixed - -
    -
    - -
    Parameters
    -
    -
    - $id - : string -
    -
    - -
    -
    -
    Tags - +
    @@ -434,15 +359,7 @@
    -
    -
    Return values
    - mixed - — -

    null:不存在 false:不支持

    -
    - -
    - +
    @@ -559,8 +476,7 @@
    Return values
    diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwooleCoroutine.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwooleCoroutine.html index b0c63b0..02ca192 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwooleCoroutine.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwooleCoroutine.html @@ -171,28 +171,21 @@

     : mixed -
    初始化
    +
    创建协程
    __destruct()  : mixed
    -
    销毁
    +
    销毁协程
    - create() - -  : string -
    -
    创建一个协程
    - -
    - query() + origin()  : mixed
    -
    获取协程对象,部分实现不支持
    +
    获取协程原始返回
    @@ -222,22 +215,32 @@

    -

    初始化

    +

    创建协程

    public - __construct() : mixed + __construct(Closure $func) : mixed
    - +

    Parameters
    +
    +
    + $func + : Closure +
    +
    + +
    +
    +
    Tags @@ -272,12 +275,12 @@

    -

    销毁

    +

    销毁协程

    public @@ -314,112 +317,34 @@
    -public " > -

    - create() - +

    + origin() +

    -

    创建一个协程

    +

    获取协程原始返回

    public - create(Closure $func) : string + origin() : mixed
    -

    Parameters
    -
    -
    - $func - : Closure -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    -
    Return values
    - string - — -

    协程id

    -
    - -
    - - -
    -

    - query() - - -

    - - -

    获取协程对象,部分实现不支持

    - - - public - query(string $id) : mixed - -
    -
    - -
    Parameters
    -
    -
    - $id - : string -
    -
    - -
    -
    -
    Tags - +
    @@ -434,15 +359,7 @@
    -
    -
    Return values
    - mixed - — -

    null:不存在 false:不支持

    -
    - -
    - +
    @@ -559,8 +476,7 @@
    Return values
    diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwowCoroutine.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwowCoroutine.html index 0069426..34b73a6 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwowCoroutine.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwowCoroutine.html @@ -171,28 +171,21 @@

     : mixed -
    初始化
    +
    创建协程
    __destruct()  : mixed
    -
    销毁
    +
    销毁协程
    - create() - -  : string -
    -
    创建一个协程
    - -
    - query() + origin()  : mixed
    -
    获取协程对象,部分实现不支持
    +
    获取协程原始返回
    @@ -222,22 +215,32 @@

    -

    初始化

    +

    创建协程

    public - __construct() : mixed + __construct(Closure $func) : mixed
    - +

    Parameters
    +
    +
    + $func + : Closure +
    +
    + +
    +
    +
    Tags @@ -272,12 +275,12 @@

    -

    销毁

    +

    销毁协程

    public @@ -314,112 +317,34 @@
    -public " > -

    - create() - +

    + origin() +

    -

    创建一个协程

    +

    获取协程原始返回

    public - create(Closure $func) : string + origin() : mixed
    -

    Parameters
    -
    -
    - $func - : Closure -
    -
    - -
    -
    - - -
    - Tags - - -
    -
    -
    - inheritdoc -
    -
    - - -
    -
    - - - -
    -
    Return values
    - string - — -

    协程id

    -
    - -
    - - -
    -

    - query() - - -

    - - -

    获取协程对象,部分实现不支持

    - - - public - query(string $id) : mixed - -
    -
    - -
    Parameters
    -
    -
    - $id - : string -
    -
    - -
    -
    -
    Tags - +
    @@ -434,15 +359,7 @@
    -
    -
    Return values
    - mixed - — -

    null:不存在 false:不支持

    -
    - -
    - +
    @@ -559,8 +476,7 @@
    Return values
    diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-Handlers-RippleWaitGroup.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-Handlers-RippleWaitGroup.html index 11a7945..5635f06 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-Handlers-RippleWaitGroup.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-Handlers-RippleWaitGroup.html @@ -336,9 +336,9 @@

    增加一个计数

    @@ -400,9 +400,9 @@

    返回计数

    @@ -454,9 +454,9 @@

    完成一个计数

    @@ -508,9 +508,9 @@

    阻塞等待

    diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-Handlers-SwooleWaitGroup.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-Handlers-SwooleWaitGroup.html index 6dda02c..3d0f622 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-Handlers-SwooleWaitGroup.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-Handlers-SwooleWaitGroup.html @@ -124,9 +124,9 @@

    @@ -236,9 +236,9 @@

    初始化

    @@ -286,9 +286,9 @@

    销毁

    @@ -336,9 +336,9 @@

    增加一个计数

    @@ -400,9 +400,9 @@

    返回计数

    @@ -454,9 +454,9 @@

    完成一个计数

    @@ -508,9 +508,9 @@

    阻塞等待

    diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-Handlers-SwowWaitGroup.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-Handlers-SwowWaitGroup.html index 6382131..b90199f 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-Handlers-SwowWaitGroup.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-Handlers-SwowWaitGroup.html @@ -336,9 +336,9 @@

    增加一个计数

    @@ -400,9 +400,9 @@

    返回计数

    @@ -454,9 +454,9 @@

    完成一个计数

    @@ -508,9 +508,9 @@

    阻塞等待

    diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-WaitGroup.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-WaitGroup.html index fea76e4..7917e0b 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-WaitGroup.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-WaitGroup.html @@ -172,6 +172,13 @@

    构造方法
    +
    + __destruct() + +  : mixed +
    +
    析构方法
    +
    add() @@ -257,9 +264,9 @@

    代理调用WaitGroupInterface方法

    @@ -331,6 +338,42 @@

    + +
    +

    + __destruct() + + +

    + + +

    析构方法

    + + + public + __destruct() : mixed + +
    +
    + + + + + + + +
    @@ -693,9 +736,9 @@

    @@ -902,6 +945,7 @@

    Parameters
    • __call()
    • __construct()
    • +
    • __destruct()
    • add()
    • count()
    • done()
    • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-AbstractWorker.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-AbstractWorker.html index 194e647..85283de 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-AbstractWorker.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-AbstractWorker.html @@ -125,9 +125,9 @@

      @@ -160,20 +160,6 @@

      -
      - __construct() - -  : mixed -
      -
      构造
      - -
      - getCoroutine() - -  : Coroutine -
      -
      获取协程组件
      -
      run() @@ -199,99 +185,6 @@

      -method -public " -> -

      - __construct() - - -

      - - -

      构造

      - - - public - __construct([string $socket_name = '' ][, array<string|int, mixed> $context_option = array() ]) : mixed - -
      -
      - - -
      Parameters
      -
      -
      - $socket_name - : string - = ''
      -
      - -
      -
      - $context_option - : array<string|int, mixed> - = array()
      -
      - -
      -
      - - - - - - -
    -
    -

    - getCoroutine() - - -

    - - -

    获取协程组件

    - - - public - getCoroutine() : Coroutine - -
    -
    - - - - - - - -
    -
    Return values
    - Coroutine -
    - -
    -

    run() @@ -301,9 +194,9 @@

    @@ -449,8 +342,6 @@

  • Methods
  • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-Server.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-Server.html index a53ab1c..e1924ed 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-Server.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-Server.html @@ -169,13 +169,6 @@

    -
    - __construct() - -  : mixed -
    -
    构造
    -
    getConnectionChannels() @@ -197,13 +190,6 @@

    获取连接队列消费者数量
    -
    - getCoroutine() - -  : Coroutine -
    -
    获取协程组件
    -
    getParentOnClose() @@ -267,59 +253,6 @@

    -method -public " -> -

    - __construct() - - -

    - - -

    构造

    - - - public - __construct([string $socket_name = '' ][, array<string|int, mixed> $context_option = array() ]) : mixed - -
    -
    - - -
    Parameters
    -
    -
    - $socket_name - : string - = ''
    -
    - -
    -
    - $context_option - : array<string|int, mixed> - = array()
    -
    - -
    -
    - - - - - - -
    -

    getConnectionChannels() @@ -329,9 +262,9 @@

    获取所有连接队列

    @@ -369,9 +302,9 @@

    获取连接队列容量

    @@ -409,9 +342,9 @@

    获取连接队列消费者数量

    @@ -434,46 +367,6 @@

    Return values
    int -
    -
    -

    - getCoroutine() - - -

    - - -

    获取协程组件

    - - - public - getCoroutine() : Coroutine - -
    -
    - - - - - - - -
    -
    Return values
    - Coroutine -
    -
    @@ -542,9 +435,9 @@

    @@ -595,9 +488,9 @@

    @@ -648,9 +541,9 @@

    @@ -697,9 +590,9 @@

    设置连接队列容量

    @@ -743,9 +636,9 @@

    设置连接队列消费者数量

    @@ -789,9 +682,9 @@

    @@ -933,11 +826,9 @@

    Parameters
  • Methods
    • -
    • __construct()
    • getConnectionChannels()
    • getConnectionChannelSize()
    • getConnectionConsumerCount()
    • -
    • getCoroutine()
    • getParentOnClose()
    • getParentOnConnect()
    • getParentOnMessage()
    • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-ServerMethods.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-ServerMethods.html index f9bb966..92c4630 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-ServerMethods.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-ServerMethods.html @@ -105,9 +105,9 @@

      @@ -228,9 +228,9 @@

      获取所有连接队列

      @@ -268,9 +268,9 @@

      获取连接队列容量

      @@ -308,9 +308,9 @@

      获取连接队列消费者数量

      @@ -348,9 +348,9 @@

      @@ -401,9 +401,9 @@

      @@ -454,9 +454,9 @@

      @@ -507,9 +507,9 @@

      设置连接队列容量

      @@ -553,9 +553,9 @@

      设置连接队列消费者数量

      @@ -599,9 +599,9 @@

      diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-Worker.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-Worker.html index c4d52af..a5d0e0f 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-Worker.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-Worker.html @@ -162,20 +162,6 @@

      -
      - __construct() - -  : mixed -
      -
      构造
      - -
      - getCoroutine() - -  : Coroutine -
      -
      获取协程组件
      -
      getParentOnWorkerStart() @@ -213,99 +199,6 @@

      -method -public " -> -

      - __construct() - - -

      - - -

      构造

      - - - public - __construct([string $socket_name = '' ][, array<string|int, mixed> $context_option = array() ]) : mixed - -
      -
      - - -
      Parameters
      -
      -
      - $socket_name - : string - = ''
      -
      - -
      -
      - $context_option - : array<string|int, mixed> - = array()
      -
      - -
      -
      - - - - - - -
  • -
    -

    - getCoroutine() - - -

    - - -

    获取协程组件

    - - - public - getCoroutine() : Coroutine - -
    -
    - - - - - - - -
    -
    Return values
    - Coroutine -
    - -
    -

    getParentOnWorkerStart() @@ -315,9 +208,9 @@

    @@ -354,9 +247,9 @@

    @@ -393,9 +286,9 @@

    @@ -541,8 +434,6 @@

  • Methods
    • -
    • __construct()
    • -
    • getCoroutine()
    • getParentOnWorkerStart()
    • getParentOnWorkerStop()
    • run()
    • diff --git a/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-WorkerMethods.html b/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-WorkerMethods.html index 1ebf10d..fe02f32 100644 --- a/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-WorkerMethods.html +++ b/docs/classes/Workbunny-WebmanCoroutine-Utils-Worker-WorkerMethods.html @@ -105,9 +105,9 @@

      @@ -181,9 +181,9 @@

      @@ -220,9 +220,9 @@

      diff --git a/docs/files/src-helpers.html b/docs/files/src-helpers.html index 3084a94..66f90a2 100644 --- a/docs/files/src-helpers.html +++ b/docs/files/src-helpers.html @@ -234,9 +234,9 @@

      判断是否composer安装了指定包

      diff --git a/docs/files/src-utils-tools.html b/docs/files/src-utils-tools.html index 8ad4c6c..7e4d62b 100644 --- a/docs/files/src-utils-tools.html +++ b/docs/files/src-utils-tools.html @@ -179,9 +179,9 @@

      diff --git a/docs/files/src/CoroutineWebServer.php.txt b/docs/files/src/CoroutineWebServer.php.txt index adc16c2..534c9f3 100644 --- a/docs/files/src/CoroutineWebServer.php.txt +++ b/docs/files/src/CoroutineWebServer.php.txt @@ -9,6 +9,7 @@ namespace Workbunny\WebmanCoroutine; use Webman\App; use Webman\Http\Request; +use Workbunny\WebmanCoroutine\Handlers\HandlerInterface; use Workbunny\WebmanCoroutine\Utils\Channel\Channel; use Workbunny\WebmanCoroutine\Utils\Coroutine\Coroutine; use Workbunny\WebmanCoroutine\Utils\WaitGroup\WaitGroup; @@ -26,19 +27,16 @@ class CoroutineWebServer extends App */ protected array $_connectionChannels = []; - /** - * @var Coroutine|null - */ - protected ?Coroutine $_coroutine = null; - /** @inheritdoc */ public function onWorkerStart($worker) { if (!\config('plugin.workbunny.webman-coroutine.app.enable', false)) { return; } - $this->_coroutine = new Coroutine(); parent::onWorkerStart($worker); + /** @var HandlerInterface $handler */ + $handler = Factory::getCurrentHandler(); + $handler::initEnv(); } /** @@ -71,9 +69,12 @@ class CoroutineWebServer extends App return; } if (is_callable($call = [parent::class, 'onConnect'])) { - call_user_func($call, $connection, ...$params); + // 协程化创建连接 + new Coroutine(function () use ($call, $connection, $params) { + call_user_func($call, $connection, ...$params); + }); } - if (!$this->_connectionChannels[$id = spl_object_hash($connection)] ?? null) { + if (!($this->_connectionChannels[$id = spl_object_hash($connection)] ?? null)) { $this->_connectionChannels[$id] = new Channel(\config('plugin.workbunny.webman-coroutine.app.channel_size', 1)); } } @@ -93,7 +94,10 @@ class CoroutineWebServer extends App return; } if (is_callable($call = [parent::class, 'onClose'])) { - call_user_func($call, $connection, ...$params); + // 协程化关闭连接 + new Coroutine(function () use ($call, $connection, $params) { + call_user_func($call, $connection, ...$params); + }); } unset($this->_connectionChannels[spl_object_hash($connection)]); } @@ -112,16 +116,16 @@ class CoroutineWebServer extends App return null; } // 为每一个连接创建一个通道 - $channel = $this->_connectionChannels[spl_object_hash($connection)]; + $channel = $this->_connectionChannels[spl_object_hash($connection)] ?? new Channel(\config('plugin.workbunny.webman-coroutine.app.channel_size', 1)); // 请求生产 $channel->push(func_get_args()); $waitGroup = new WaitGroup(); // 根据request consumer数量创建协程 - $consumerCount = config('plugin.workbunny.webman-coroutine.app.consumer_count', 1); + $consumerCount = max(1, config('plugin.workbunny.webman-coroutine.app.consumer_count', 1)); foreach (range(1, $consumerCount) as $ignored) { $waitGroup->add(); // 请求消费协程 - $this->_coroutine->create(function () use ($channel, $waitGroup) { + new Coroutine(function () use ($channel, $waitGroup) { while (true) { // 通道为空或者关闭时退出协程 if ( diff --git a/docs/files/src/Events/SwooleEvent.php.txt b/docs/files/src/Events/SwooleEvent.php.txt index 146576b..8690c59 100644 --- a/docs/files/src/Events/SwooleEvent.php.txt +++ b/docs/files/src/Events/SwooleEvent.php.txt @@ -8,6 +8,7 @@ declare(strict_types=1); namespace Workbunny\WebmanCoroutine\Events; +use Swoole\Coroutine; use Swoole\Event; use Swoole\Process; use Swoole\Timer; @@ -168,7 +169,13 @@ class SwooleEvent implements EventInterface /** @inheritdoc */ public function destroy() { + // 移除所有定时器 $this->clearAllTimer(); + // 退出所有协程 + foreach (Coroutine::listCoroutines() as $coroutine) { + Coroutine::cancel($coroutine); + } + // 退出event loop Event::exit(); $this->_reads = $this->_writes = []; } diff --git a/docs/files/src/Factory.php.txt b/docs/files/src/Factory.php.txt index ee05131..6292163 100644 --- a/docs/files/src/Factory.php.txt +++ b/docs/files/src/Factory.php.txt @@ -7,7 +7,6 @@ declare(strict_types=1); namespace Workbunny\WebmanCoroutine; -use Webman\Http\Request; use Workbunny\WebmanCoroutine\Events\SwooleEvent; use Workbunny\WebmanCoroutine\Events\SwowEvent; use Workbunny\WebmanCoroutine\Handlers\DefaultHandler; @@ -17,8 +16,6 @@ use Workbunny\WebmanCoroutine\Handlers\SwooleHandler; use Workbunny\WebmanCoroutine\Handlers\SwooleWorkerman5Handler; use Workbunny\WebmanCoroutine\Handlers\SwowHandler; use Workbunny\WebmanCoroutine\Handlers\SwowWorkerman5Handler; -use Workerman\Connection\ConnectionInterface; -use Workerman\Worker; /** * 工厂化启动器 @@ -53,7 +50,9 @@ class Factory protected static ?string $_currentEventLoop = null; /** - * @return string|null + * 获取当前事件循环 + * + * @return string|null null:未初始化 空字符串:默认事件 */ public static function getCurrentEventLoop(): ?string { @@ -63,12 +62,11 @@ class Factory /** * 获取当前使用的处理器类名 * - * @return string|null + * @return string|null null:未初始化 */ public static function getCurrentHandler(): ?string { - return self::$_handlers[self::getCurrentEventLoop()] ?? - (self::getCurrentEventLoop() === null ? DefaultHandler::class : null); + return self::get(self::$_currentEventLoop) ?: (self::getCurrentEventLoop() === null ? null : DefaultHandler::class); } /** @@ -122,47 +120,12 @@ class Factory /** * 根据事件循环类获取对应处理器 * - * @param string $eventLoopClass 指定的事件循环类 - * @param bool $available 是否校验当前环境可用性 - * @param bool $returnEventLoopClass 只在available=true时生效 - * @return string - */ - public static function get(string $eventLoopClass, bool $available = false, bool $returnEventLoopClass = false): string - { - /** @var HandlerInterface $handlerClass */ - $handlerClass = self::$_handlers[$eventLoopClass] ?? DefaultHandler::class; - if ($available) { - // 当$returnEventLoopClass=true时,返回的是eventloop classname而不是handler classname - $handlerClass = $handlerClass::isAvailable() - ? ($returnEventLoopClass - ? (isset(self::$_handlers[$eventLoopClass])) ? $eventLoopClass : self::WORKERMAN_DEFAULT - : $handlerClass) - : ($returnEventLoopClass ? self::WORKERMAN_DEFAULT : DefaultHandler::class); - } - - return $handlerClass; - } - - /** - * 根据当前环境获取可用的处理器 - * - * @param bool $returnEventLoopClass 是否返回事件循环类名 - * @return string 事件循环类名|处理器类名|空字符串 + * @param null|string $eventLoopClass 指定的事件循环类 + * @return string|null null:未找到 */ - public static function find(bool $returnEventLoopClass = false): string + public static function get(?string $eventLoopClass): ?string { - /** - * @var string $eventLoopClass - * @var HandlerInterface $handlerClass - */ - foreach (self::getAll() as $eventLoopClass => $handlerClass) { - // 判断当前环境是否可用,相同可用的取优先 - if ($handlerClass::isAvailable()) { - return $returnEventLoopClass ? $eventLoopClass : $handlerClass; - } - } - - return $returnEventLoopClass ? self::WORKERMAN_DEFAULT : DefaultHandler::class; + return self::$_handlers[$eventLoopClass] ?? null; } /** @@ -174,48 +137,25 @@ class Factory public static function init(?string $eventLoopClass): void { if (!self::$_currentEventLoop) { - // 赋值,避免重复获取 - self::$_currentEventLoop = ( - // 如果没有就自动获取 - $eventLoopClass ? self::get($eventLoopClass, true, true) : self::find(true) - ); + if ($eventLoopClass === null) { + $handlers = self::getAll(); + } else { + $handlers = self::get($eventLoopClass) ? [$eventLoopClass => self::get($eventLoopClass)] : []; + } + // 默认处理器 + $eventLoopClass = self::WORKERMAN_DEFAULT; + /** + * @var string $eventloop + * @var HandlerInterface $handler + */ + foreach ($handlers as $eventloop => $handler) { + if ($handler::isAvailable()) { + $eventLoopClass = $eventloop; + break; + } + } + // 赋值 + self::$_currentEventLoop = $eventLoopClass; } } - - /** - * 根据当前环境运行处理器 - * - * @param CoroutineServerInterface $app 实现CoroutineServerInterface - * @param mixed|ConnectionInterface $connection 连接资源 - * @param mixed|Request $request 请求体 - * @param string|null $eventLoopClass null:根据环境获取事件循环类 - * @return mixed - */ - public static function run(CoroutineServerInterface $app, mixed $connection, mixed $request, ?string $eventLoopClass = null): mixed - { - self::init($eventLoopClass); - // 获取当前处理器 - /** @var HandlerInterface $handlerClass */ - $handlerClass = self::getCurrentHandler(); - - return $handlerClass::onMessage($app, $connection, $request); - } - - /** - * 根据当前环境运行处理器 - * - * @param CoroutineWorkerInterface $app 实现CoroutineWorkerInterface - * @param mixed|Worker|null $worker worker对象 - * @param string|null $eventLoopClass null:根据环境获取事件循环类 - * @return mixed - */ - public static function start(CoroutineWorkerInterface $app, mixed $worker = null, ?string $eventLoopClass = null): mixed - { - self::init($eventLoopClass); - // 获取当前处理器 - /** @var HandlerInterface $handlerClass */ - $handlerClass = self::getCurrentHandler(); - - return $handlerClass::onWorkerStart($app, $worker); - } } diff --git a/docs/files/src/Handlers/DefaultHandler.php.txt b/docs/files/src/Handlers/DefaultHandler.php.txt index 7383533..4ded56b 100644 --- a/docs/files/src/Handlers/DefaultHandler.php.txt +++ b/docs/files/src/Handlers/DefaultHandler.php.txt @@ -8,8 +8,6 @@ declare(strict_types=1); namespace Workbunny\WebmanCoroutine\Handlers; use Closure; -use Workbunny\WebmanCoroutine\CoroutineServerInterface; -use Workbunny\WebmanCoroutine\CoroutineWorkerInterface; /** * 默认处理器,使用workerman基础事件 @@ -27,53 +25,11 @@ class DefaultHandler implements HandlerInterface } /** - * default handler不会创建协程 + * default handler无需初始化 * * @inheritdoc */ - public static function onMessage(CoroutineServerInterface $app, mixed $connection, mixed $request): mixed - { - return $app->parentOnMessage($connection, $request); - } - - /** - * default handler不会创建协程 - * - * @inheritdoc - */ - public static function onWorkerStart(CoroutineWorkerInterface $app, mixed $worker): mixed - { - return $app->parentOnWorkerStart($worker); - } - - /** - * default handler不会创建协程 - * - * @inheritdoc - */ - public static function coroutineCreate(Closure $function, ?string $waitGroupId = null): mixed - { - return call_user_func($function); - } - - /** - * default handler不会创建waitGroup - * - * @inheritdoc - */ - public static function waitGroupCreate(): string - { - return ''; - } - - /** - * default handler不会等待waitGroup - * - * @param string $waitGroupId - * @param int $timeout - * @inheritdoc - */ - public static function waitGroupWait(string $waitGroupId, int $timeout = -1): void + public static function initEnv(): void { } } diff --git a/docs/files/src/Handlers/HandlerInterface.php.txt b/docs/files/src/Handlers/HandlerInterface.php.txt index e433689..82bee90 100644 --- a/docs/files/src/Handlers/HandlerInterface.php.txt +++ b/docs/files/src/Handlers/HandlerInterface.php.txt @@ -7,13 +7,6 @@ declare(strict_types=1); namespace Workbunny\WebmanCoroutine\Handlers; -use Closure; -use Webman\Http\Request; -use Workbunny\WebmanCoroutine\CoroutineServerInterface; -use Workbunny\WebmanCoroutine\CoroutineWorkerInterface; -use Workbunny\WebmanCoroutine\Exceptions\RuntimeException; -use Workerman\Connection\ConnectionInterface; - /** * 协程处理器接口 */ @@ -27,50 +20,9 @@ interface HandlerInterface public static function isAvailable(): bool; /** - * 执行协程处理 - * - * @param CoroutineServerInterface $app - * @param mixed|ConnectionInterface $connection - * @param mixed|Request $request - * @return mixed - * @throws RuntimeException - */ - public static function onMessage(CoroutineServerInterface $app, mixed $connection, mixed $request): mixed; - - /** - * 执行协程处理 - * - * @param CoroutineWorkerInterface $app - * @param mixed $worker - * @return mixed - * @throws RuntimeException - */ - public static function onWorkerStart(CoroutineWorkerInterface $app, mixed $worker): mixed; - - /** - * 创建一个协程 - * - * @param Closure $function 协程执行逻辑 - * @param string|null $waitGroupId null:不使用waitGroup - * @return mixed - * @throws RuntimeException - */ - public static function coroutineCreate(Closure $function, null|string $waitGroupId = null): mixed; - - /** - * 创建一个waitGroup - * - * @return string 返回waitGroupId - */ - public static function waitGroupCreate(): string; - - /** - * 阻塞等待一个waitGroup完成 + * 用于环境加载初始化 * - * @param string $waitGroupId - * @param int $timeout 默认无超时时间 * @return void - * @throws RuntimeException */ - public static function waitGroupWait(string $waitGroupId, int $timeout = -1): void; + public static function initEnv(): void; } diff --git a/docs/files/src/Handlers/RippleHandler.php.txt b/docs/files/src/Handlers/RippleHandler.php.txt index cf38446..2802bf8 100644 --- a/docs/files/src/Handlers/RippleHandler.php.txt +++ b/docs/files/src/Handlers/RippleHandler.php.txt @@ -7,30 +7,13 @@ declare(strict_types=1); namespace Workbunny\WebmanCoroutine\Handlers; -use Closure; - -use function Co\async; -use function Co\await; - -use Psc\Core\Coroutine\Promise; -use Throwable; -use Workbunny\WebmanCoroutine\CoroutineServerInterface; -use Workbunny\WebmanCoroutine\CoroutineWorkerInterface; -use Workbunny\WebmanCoroutine\Exceptions\HandlerException; - use function Workbunny\WebmanCoroutine\package_installed; -use Workerman\Worker; - /** * 基于Ripple插件的协程处理器,支持PHP-fiber */ class RippleHandler implements HandlerInterface { - /** - * @var \stdClass[] - */ - protected static array $_waitGroups = []; /** @inheritdoc */ public static function isAvailable(): bool @@ -38,89 +21,12 @@ class RippleHandler implements HandlerInterface return package_installed('cclilshy/p-ripple-drive'); } - /** @inheritdoc */ - public static function onMessage(CoroutineServerInterface $app, mixed $connection, mixed $request): mixed - { - try { - return await( - async(function () use ($app, $connection, $request) { - return $app->parentOnMessage($connection, $request); - }) - ); - } catch (Throwable $e) { - Worker::log($e->getMessage()); - } - - return null; - } - - /** @inheritdoc */ - public static function onWorkerStart(CoroutineWorkerInterface $app, mixed $worker): mixed - { - try { - return await( - async(function () use ($app, $worker) { - return $app->parentOnWorkerStart($worker); - }) - ); - } catch (Throwable $e) { - Worker::log($e->getMessage()); - } - - return null; - } - - /** - * @inheritdoc - * @param Closure $function - * @param string|null $waitGroupId - * @return Promise - * @throws HandlerException 使用一个不存在的waitGroupId会抛出异常 - */ - public static function coroutineCreate(Closure $function, ?string $waitGroupId = null): Promise - { - $promise = async($function); - if ($waitGroupId !== null) { - if (!($waitGroup = self::$_waitGroups[$waitGroupId] ?? null)) { - throw new HandlerException("WaitGroup $waitGroupId not found [coroutine create]. "); - } - $waitGroup->promiseList[spl_object_hash($promise)] = $promise; - } - - return $promise; - } - - /** - * @inheritdoc - * @return string - */ - public static function waitGroupCreate(): string - { - $waitGroup = new \stdClass(); - self::$_waitGroups[$id = spl_object_hash($waitGroup)] = $waitGroup; - - return $id; - } - /** + * ripple handler无需初始化 + * * @inheritdoc - * @param string $waitGroupId - * @param int $timeout ripple不生效 - * @return void - * @throws Throwable */ - public static function waitGroupWait(string $waitGroupId, int $timeout = -1): void + public static function initEnv(): void { - if (!($waitGroup = self::$_waitGroups[$waitGroupId] ?? null)) { - throw new HandlerException("WaitGroup $waitGroupId not found [wait]. "); - } - try { - foreach ($waitGroup->promiseList as $key => $promise) { - await($promise); - unset($waitGroup->promiseList[$key]); - } - } finally { - unset(self::$_waitGroups[$waitGroupId]); - } } } diff --git a/docs/files/src/Handlers/SwooleHandler.php.txt b/docs/files/src/Handlers/SwooleHandler.php.txt index 2540125..57d3711 100644 --- a/docs/files/src/Handlers/SwooleHandler.php.txt +++ b/docs/files/src/Handlers/SwooleHandler.php.txt @@ -7,15 +7,7 @@ declare(strict_types=1); namespace Workbunny\WebmanCoroutine\Handlers; -use Closure; -use Swoole\Coroutine; -use Swoole\Coroutine\Channel; -use Swoole\Coroutine\WaitGroup; use Swoole\Runtime; -use Workbunny\WebmanCoroutine\CoroutineServerInterface; -use Workbunny\WebmanCoroutine\CoroutineWorkerInterface; -use Workbunny\WebmanCoroutine\Exceptions\HandlerException; -use Workbunny\WebmanCoroutine\Exceptions\SkipWaitGroupDoneException; use Workerman\Worker; /** @@ -23,178 +15,15 @@ use Workerman\Worker; */ class SwooleHandler implements HandlerInterface { - /** - * 启用标识 - * - * @var bool - */ - protected static bool $_enable = false; - - /** - * connection channel - * - * @var array - */ - protected static array $_connectionChannels = []; - - /** - * @var WaitGroup[] - */ - protected static array $_waitGroups = []; - - /** - * 创建通道 - * - * @param string $id - * @return Channel - */ - protected static function _createChannel(string $id): Channel - { - return self::$_connectionChannels[$id] ?? new Channel(config('plugin.workbunny.webman-coroutine.app.channel_size', 1)); - } - - /** - * 关闭通道 - * - * @param string $id - * @return void - */ - protected static function _closeChannel(string $id): void - { - if (self::$_connectionChannels[$id] ?? null) { - self::$_connectionChannels[$id]?->close(); - unset(self::$_connectionChannels[$id]); - } - } - /** @inheritdoc */ public static function isAvailable(): bool { return !version_compare(Worker::VERSION, '5.0.0', '>=') and extension_loaded('swoole'); } - /** @inheritdoc */ - public static function onMessage(CoroutineServerInterface $app, mixed $connection, mixed $request): mixed - { - if (!is_object($connection)) { - return null; - } - if (!self::$_enable) { - self::$_enable = true; - Runtime::enableCoroutine(); - } - // 为每一个连接创建一个通道 - $connectionChannels = self::_createChannel($id = spl_object_hash($connection)); - // 将请求信息推送到通道 - $connectionChannels->push([ - $connection, - $request, - ]); - $waitGroup = new WaitGroup(); - // 根据request consumer数量创建协程 - $consumerCount = config('plugin.workbunny.webman-coroutine.app.consumer_count', 1); - foreach (range(1, $consumerCount) as $ignored) { - // 协程监听通道,消费 - $res = Coroutine::create(function () use ($app, $connectionChannels, $waitGroup) { - while (true) { - // 通道为空或者关闭时退出协程 - if ( - $connectionChannels->isEmpty() or - !$data = $connectionChannels->pop() - ) { - break; - } - [$connection, $request] = $data; - $app->parentOnMessage($connection, $request); - } - $waitGroup->done(); - }); - if ($res) { - $waitGroup->add(); - } - } - $waitGroup->wait(); - // 关闭通道 - self::_closeChannel($id); - - return null; - } - - /** @inheritdoc */ - public static function onWorkerStart(CoroutineWorkerInterface $app, mixed $worker): mixed - { - if (!self::$_enable) { - self::$_enable = true; - Runtime::enableCoroutine(); - } - $waitGroup = new WaitGroup(); - $waitGroup->add(); - $res = null; - Coroutine::create(function () use (&$res, $app, $worker, $waitGroup) { - $res = $app->parentOnWorkerStart($worker); - $waitGroup->done(); - }); - $waitGroup->wait(); - - return $res; - } - - /** - * @inheritdoc - * @param Closure $function - * @param string|null $waitGroupId - * @return int|bool - */ - public static function coroutineCreate(Closure $function, ?string $waitGroupId = null): int|bool - { - $res = Coroutine::create(function () use ($function, $waitGroupId) { - try { - call_user_func($function); - } catch (SkipWaitGroupDoneException) { - // 特定异常才会跳过waitGroup等待 - return; - } - if ($waitGroup = self::$_waitGroups[$waitGroupId] ?? null) { - $waitGroup->done(); - } - }); - if ($waitGroupId !== null) { - if (!($waitGroup = self::$_waitGroups[$waitGroupId] ?? null)) { - throw new HandlerException("WaitGroup $waitGroupId not found [coroutine create]. "); - } - if ($res) { - $waitGroup->add(); - } - } - - return $res; - } - - /** - * @inheritdoc - * @return string - */ - public static function waitGroupCreate(): string - { - self::$_waitGroups[ - $id = spl_object_hash($waitGroup = new WaitGroup()) - ] = $waitGroup; - - return $id; - } - - /** - * @inheritdoc - * @param string $waitGroupId - * @param int $timeout - * @return void - */ - public static function waitGroupWait(string $waitGroupId, int $timeout = -1): void + /** @inheritdoc */ + public static function initEnv(): void { - if (!($waitGroup = self::$_waitGroups[$waitGroupId] ?? null)) { - throw new HandlerException("WaitGroup $waitGroupId not found [coroutine create]. "); - } - $waitGroup->wait($timeout); - unset(self::$_waitGroups[$waitGroupId]); + Runtime::enableCoroutine(); } } diff --git a/docs/files/src/Handlers/SwowHandler.php.txt b/docs/files/src/Handlers/SwowHandler.php.txt index e721259..d0ae81d 100644 --- a/docs/files/src/Handlers/SwowHandler.php.txt +++ b/docs/files/src/Handlers/SwowHandler.php.txt @@ -7,14 +7,6 @@ declare(strict_types=1); namespace Workbunny\WebmanCoroutine\Handlers; -use Closure; -use Swow\Channel; -use Swow\Coroutine; -use Swow\Sync\WaitGroup; -use Workbunny\WebmanCoroutine\CoroutineServerInterface; -use Workbunny\WebmanCoroutine\CoroutineWorkerInterface; -use Workbunny\WebmanCoroutine\Exceptions\HandlerException; -use Workbunny\WebmanCoroutine\Exceptions\SkipWaitGroupDoneException; use Workerman\Worker; /** @@ -22,42 +14,6 @@ use Workerman\Worker; */ class SwowHandler implements HandlerInterface { - /** - * connection channel - * - * @var array - */ - protected static array $_connectionChannels = []; - - /** - * @var WaitGroup[] - */ - protected static array $_waitGroups = []; - - /** - * 创建通道 - * - * @param string $id - * @return Channel - */ - protected static function _createChannel(string $id): Channel - { - return self::$_connectionChannels[$id] ?? new Channel(config('plugin.workbunny.webman-coroutine.app.channel_size', 1)); - } - - /** - * 关闭通道 - * - * @param string $id - * @return void - */ - protected static function _closeChannel(string $id): void - { - if (self::$_connectionChannels[$id] ?? null) { - self::$_connectionChannels[$id]?->close(); - unset(self::$_connectionChannels[$id]); - } - } /** @inheritdoc */ public static function isAvailable(): bool @@ -65,116 +21,12 @@ class SwowHandler implements HandlerInterface return !version_compare(Worker::VERSION, '5.0.0', '>=') and extension_loaded('swow'); } - /** @inheritdoc */ - public static function onMessage(CoroutineServerInterface $app, mixed $connection, mixed $request): mixed - { - if (!is_object($connection)) { - return null; - } - // 为每一个连接创建一个通道 - $connectionChannel = self::_createChannel($id = spl_object_hash($connection)); - // 请求生产 - $connectionChannel->push([ - $connection, - $request, - ]); - $waitGroup = new WaitGroup(); - // 根据request consumer数量创建协程 - $consumerCount = config('plugin.workbunny.webman-coroutine.app.consumer_count', 1); - foreach (range(1, $consumerCount) as $ignored) { - $waitGroup->add(); - // 请求消费协程 - Coroutine::run(function () use ($app, $connectionChannel, $waitGroup) { - while (true) { - // 通道为空或者关闭时退出协程 - if ( - $connectionChannel->isEmpty() or - !$data = $connectionChannel->pop() - ) { - break; - } - [$connection, $request] = $data; - $app->parentOnMessage($connection, $request); - } - $waitGroup->done(); - }); - } - $waitGroup->wait(); - // 关闭通道 - self::_closeChannel($id); - - return null; - } - - /** @inheritdoc */ - public static function onWorkerStart(CoroutineWorkerInterface $app, mixed $worker): mixed - { - $waitGroup = new WaitGroup(); - $res = null; - $waitGroup->add(); - Coroutine::run(function () use (&$res, $app, $worker, $waitGroup) { - $res = $app->parentOnWorkerStart($worker); - $waitGroup->done(); - }); - $waitGroup->wait(); - - return $res; - } - - /** - * @inheritdoc - * @param Closure $function - * @param string|null $waitGroupId - * @return Coroutine - */ - public static function coroutineCreate(Closure $function, ?string $waitGroupId = null): Coroutine - { - $res = Coroutine::run(function () use ($function, $waitGroupId) { - try { - call_user_func($function); - } catch (SkipWaitGroupDoneException) { - // 特定异常才会跳过waitGroup等待 - return; - } - if ($waitGroup = self::$_waitGroups[$waitGroupId] ?? null) { - $waitGroup->done(); - } - }); - if ($waitGroupId !== null) { - if (!($waitGroup = self::$_waitGroups[$waitGroupId] ?? null)) { - throw new HandlerException("WaitGroup $waitGroupId not found [coroutine create]. "); - } - $waitGroup->add(); - } - - return $res; - } - - /** - * @inheritdoc - * @return string - */ - public static function waitGroupCreate(): string - { - self::$_waitGroups[ - $id = spl_object_hash($waitGroup = new WaitGroup()) - ] = $waitGroup; - - return $id; - } - /** + * swow handler无需初始化 + * * @inheritdoc - * @param string $waitGroupId - * @param int $timeout - * @return void */ - public static function waitGroupWait(string $waitGroupId, int $timeout = -1): void + public static function initEnv(): void { - if (!($waitGroup = self::$_waitGroups[$waitGroupId] ?? null)) { - throw new HandlerException("WaitGroup $waitGroupId not found [coroutine create]. "); - } - $waitGroup->wait($timeout); - unset(self::$_waitGroups[$waitGroupId]); } } diff --git a/docs/files/src/Utils/Channel/Channel.php.txt b/docs/files/src/Utils/Channel/Channel.php.txt index 9eea9d4..a76555b 100644 --- a/docs/files/src/Utils/Channel/Channel.php.txt +++ b/docs/files/src/Utils/Channel/Channel.php.txt @@ -28,9 +28,9 @@ class Channel use RegisterMethods; /** - * @var ChannelInterface + * @var null|ChannelInterface */ - protected ChannelInterface $_interface; + protected ?ChannelInterface $_interface; /** * @var string[] @@ -51,6 +51,14 @@ class Channel $this->_interface = new (self::$_handlers[Factory::getCurrentEventLoop()] ?? DefaultChannel::class)($capacity); } + /** + * 析构方法 + */ + public function __destruct() + { + $this->_interface = null; + } + /** @inheritdoc */ public static function registerVerify(mixed $value): false|string { diff --git a/docs/files/src/Utils/Channel/Handlers/DefaultChannel.php.txt b/docs/files/src/Utils/Channel/Handlers/DefaultChannel.php.txt index c268f9e..b4ea31c 100644 --- a/docs/files/src/Utils/Channel/Handlers/DefaultChannel.php.txt +++ b/docs/files/src/Utils/Channel/Handlers/DefaultChannel.php.txt @@ -31,10 +31,7 @@ class DefaultChannel implements ChannelInterface public function pop(int $timeout = -1): mixed { - if ($this->_queue) { - return $this->_queue->dequeue(); - } - return false; + return $this->_queue->dequeue(); } /** @inheritdoc @@ -43,29 +40,26 @@ class DefaultChannel implements ChannelInterface */ public function push(mixed $data, int $timeout = -1): bool { - if ($this->_queue) { - $this->_queue->enqueue($data); - return true; - } - return false; + $this->_queue->enqueue($data); + return true; } /** @inheritdoc */ public function isEmpty(): bool { - return $this->_queue?->isEmpty() ?: true; + return $this->_queue->isEmpty(); } /** @inheritdoc */ public function isFull(): bool { - return !($this->_capacity < 0) && $this->_capacity <= intval($this->_queue?->count()); + return !($this->capacity() < 0) && $this->capacity() <= intval($this->_queue?->count()); } /** @inheritdoc */ public function close(): void { - $this->_queue = null; + $this->_queue = new \SplQueue(); } /** @inheritdoc */ diff --git a/docs/files/src/Utils/Channel/Handlers/RippleChannel.php.txt b/docs/files/src/Utils/Channel/Handlers/RippleChannel.php.txt index b7ab201..fc33194 100644 --- a/docs/files/src/Utils/Channel/Handlers/RippleChannel.php.txt +++ b/docs/files/src/Utils/Channel/Handlers/RippleChannel.php.txt @@ -10,8 +10,8 @@ namespace Workbunny\WebmanCoroutine\Utils\Channel\Handlers; class RippleChannel implements ChannelInterface { - /** @var \SplQueue|null */ - protected ?\SplQueue $_queue; + /** @var \SplQueue */ + protected \SplQueue $_queue; /** @var int */ protected int $_capacity; @@ -29,9 +29,18 @@ class RippleChannel implements ChannelInterface $this->close(); } + /** + * @param int $second + * @return void + */ + protected function _sleep(int $second): void + { + \Co\sleep($second); + } + + /** @inheritdoc */ public function pop(int $timeout = -1): mixed { - if ($this->_queue) { $time = time(); while (1) { if (!$this->isEmpty()) { @@ -41,55 +50,45 @@ class RippleChannel implements ChannelInterface if ($timeout > 0 and time() - $time >= $timeout) { return false; } - \Co\sleep(0); + $this->_sleep(0); } } - - } - return false; } - /** @inheritdoc - * @param mixed $data - * @param int $timeout - */ + /** @inheritdoc */ public function push(mixed $data, int $timeout = -1): bool { - if ($this->_queue) { - $time = time(); - while (1) { - if (!$this->isFull()) { - $this->_queue->enqueue($data); - return true; - } else { - // timeout - if ($timeout > 0 and time() - $time >= $timeout) { - return false; - } - \Co\sleep(0); + $time = time(); + while (1) { + if (!$this->isFull()) { + $this->_queue->enqueue($data); + return true; + } else { + // timeout + if ($timeout > 0 and time() - $time >= $timeout) { + return false; } + $this->_sleep(0); } - } - return false; } /** @inheritdoc */ public function isEmpty(): bool { - return $this->_queue?->isEmpty() ?: true; + return $this->_queue->isEmpty(); } /** @inheritdoc */ public function isFull(): bool { - return !($this->_capacity < 0) && $this->_capacity <= intval($this->_queue?->count()); + return !($this->capacity() < 0) && $this->capacity() <= $this->_queue->count(); } /** @inheritdoc */ public function close(): void { - $this->_queue = null; + $this->_queue = new \SplQueue(); } /** @inheritdoc */ diff --git a/docs/files/src/Utils/Channel/Handlers/SwooleChannel.php.txt b/docs/files/src/Utils/Channel/Handlers/SwooleChannel.php.txt index bc7cb40..864da4d 100644 --- a/docs/files/src/Utils/Channel/Handlers/SwooleChannel.php.txt +++ b/docs/files/src/Utils/Channel/Handlers/SwooleChannel.php.txt @@ -12,8 +12,8 @@ use Swoole\Coroutine\Channel; class SwooleChannel implements ChannelInterface { - /** @var Channel|null */ - protected ?Channel $_channel; + /** @var Channel */ + protected Channel $_channel; /** @inheritdoc */ public function __construct(int $capacity = -1) @@ -30,43 +30,36 @@ class SwooleChannel implements ChannelInterface /** @inheritdoc */ public function pop(int $timeout = -1): mixed { - if ($this->_channel) { - return $this->_channel->pop($timeout); - } - return false; + return $this->_channel->pop($timeout); } /** @inheritdoc */ public function push(mixed $data, int $timeout = -1): mixed { - if ($this->_channel) { - return $this->_channel->push($data, $timeout); - } - return false; + return $this->_channel->push($data, $timeout); } /** @inheritdoc */ public function isEmpty(): bool { - return $this->_channel?->isEmpty() ?: true; + return $this->_channel->isEmpty(); } /** @inheritdoc */ public function isFull(): bool { - return $this->_channel?->isFull() ?: false; + return $this->_channel->isFull(); } /** @inheritdoc */ public function close(): void { $this->_channel->close(); - $this->_channel = null; } /** @inheritdoc */ public function capacity(): int { - return $this->_channel?->capacity ?: 0; + return $this->_channel->capacity; } } diff --git a/docs/files/src/Utils/Channel/Handlers/SwowChannel.php.txt b/docs/files/src/Utils/Channel/Handlers/SwowChannel.php.txt index d2ed4e7..ed2d19b 100644 --- a/docs/files/src/Utils/Channel/Handlers/SwowChannel.php.txt +++ b/docs/files/src/Utils/Channel/Handlers/SwowChannel.php.txt @@ -12,8 +12,8 @@ use Swow\Channel; class SwowChannel implements ChannelInterface { - /** @var Channel|null */ - protected ?Channel $_channel; + /** @var Channel */ + protected Channel $_channel; /** @inheritdoc */ public function __construct(int $capacity = -1) @@ -30,43 +30,36 @@ class SwowChannel implements ChannelInterface /** @inheritdoc */ public function pop(int $timeout = -1): mixed { - if ($this->_channel) { - return $this->_channel->pop($timeout); - } - return false; + return $this->_channel->pop($timeout); } /** @inheritdoc */ public function push(mixed $data, int $timeout = -1): mixed { - if ($this->_channel) { - return $this->_channel->push($data, $timeout); - } - return false; + return $this->_channel->push($data, $timeout); } /** @inheritdoc */ public function isEmpty(): bool { - return $this->_channel?->isEmpty() ?: true; + return $this->_channel->isEmpty(); } /** @inheritdoc */ public function isFull(): bool { - return $this->_channel?->isFull() ?: false; + return $this->_channel->isFull(); } /** @inheritdoc */ public function close(): void { $this->_channel->close(); - $this->_channel = null; } /** @inheritdoc */ public function capacity(): int { - return $this->_channel?->getCapacity() ?: 0; + return $this->_channel->getCapacity(); } } diff --git a/docs/files/src/Utils/Coroutine/Coroutine.php.txt b/docs/files/src/Utils/Coroutine/Coroutine.php.txt index d053a71..cff3e01 100644 --- a/docs/files/src/Utils/Coroutine/Coroutine.php.txt +++ b/docs/files/src/Utils/Coroutine/Coroutine.php.txt @@ -16,19 +16,17 @@ use Workbunny\WebmanCoroutine\Utils\Coroutine\Handlers\SwooleCoroutine; use Workbunny\WebmanCoroutine\Utils\Coroutine\Handlers\SwowCoroutine; use Workbunny\WebmanCoroutine\Utils\RegisterMethods; - /** - * @method string create(Closure $func) - * @method mixed query(string $id) + * @method mixed origin() */ class Coroutine { use RegisterMethods; /** - * @var CoroutineInterface + * @var CoroutineInterface|null */ - protected CoroutineInterface $_interface; + protected ?CoroutineInterface $_interface; /** * @var string[] @@ -44,9 +42,17 @@ class Coroutine /** * 构造方法 */ - public function __construct() + /** + * @param Closure $func + */ + public function __construct(Closure $func) + { + $this->_interface = new (self::$_handlers[Factory::getCurrentEventLoop()] ?? DefaultCoroutine::class)($func); + } + + public function __destruct() { - $this->_interface = new (self::$_handlers[Factory::getCurrentEventLoop()] ?? DefaultCoroutine::class)(); + $this->_interface = null; } /** @inheritdoc */ diff --git a/docs/files/src/Utils/Coroutine/Handlers/CoroutineInterface.php.txt b/docs/files/src/Utils/Coroutine/Handlers/CoroutineInterface.php.txt index 378e5b9..a6c0add 100644 --- a/docs/files/src/Utils/Coroutine/Handlers/CoroutineInterface.php.txt +++ b/docs/files/src/Utils/Coroutine/Handlers/CoroutineInterface.php.txt @@ -10,28 +10,19 @@ namespace Workbunny\WebmanCoroutine\Utils\Coroutine\Handlers; interface CoroutineInterface { /** - * 初始化 + * 创建协程 */ - public function __construct(); + public function __construct(\Closure $func); /** - * 销毁 + * 销毁协程 */ public function __destruct(); /** - * 创建一个协程 + * 获取协程原始返回 * - * @param \Closure $func - * @return string 协程id + * @return mixed */ - public function create(\Closure $func): string; - - /** - * 获取协程对象,部分实现不支持 - * - * @param string $id - * @return mixed null:不存在 false:不支持 - */ - public function query(string $id): mixed; + public function origin(): mixed; } \ No newline at end of file diff --git a/docs/files/src/Utils/Coroutine/Handlers/DefaultCoroutine.php.txt b/docs/files/src/Utils/Coroutine/Handlers/DefaultCoroutine.php.txt index 32d4e4e..c07c4a4 100644 --- a/docs/files/src/Utils/Coroutine/Handlers/DefaultCoroutine.php.txt +++ b/docs/files/src/Utils/Coroutine/Handlers/DefaultCoroutine.php.txt @@ -10,8 +10,9 @@ namespace Workbunny\WebmanCoroutine\Utils\Coroutine\Handlers; class DefaultCoroutine implements CoroutineInterface { /** @inheritdoc */ - public function __construct() + public function __construct(\Closure $func) { + call_user_func($func); } /** @inheritdoc */ @@ -20,15 +21,8 @@ class DefaultCoroutine implements CoroutineInterface } /** @inheritdoc */ - public function create(\Closure $func): string - { - call_user_func($func); - return 'coroutine_id'; - } - - /** @inheritdoc */ - public function query(string $id): bool + public function origin(): mixed { - return false; + return null; } } diff --git a/docs/files/src/Utils/Coroutine/Handlers/RippleCoroutine.php.txt b/docs/files/src/Utils/Coroutine/Handlers/RippleCoroutine.php.txt index 6058a01..8183d4b 100644 --- a/docs/files/src/Utils/Coroutine/Handlers/RippleCoroutine.php.txt +++ b/docs/files/src/Utils/Coroutine/Handlers/RippleCoroutine.php.txt @@ -7,39 +7,38 @@ declare(strict_types=1); namespace Workbunny\WebmanCoroutine\Utils\Coroutine\Handlers; +use Psc\Core\Coroutine\Promise; +use function Co\async; + class RippleCoroutine implements CoroutineInterface { /** - * @var array + * @var null|Promise */ - protected array $_promise; + protected ?Promise $_promise; - /** @inheritdoc */ - public function __construct() + /** @inheritdoc + * @param \Closure $func + */ + public function __construct(\Closure $func) { - $this->_promise = []; + $this->_promise = async(function () use (&$promise, $func) { + call_user_func($func); + // 移除协程id及promise + $this->_promise = null; + }); } /** @inheritdoc */ public function __destruct() { - $this->_promise = []; + $this->_promise = null; } /** @inheritdoc */ - public function create(\Closure $func): string + public function origin(): ?Promise { - $promise = \Co\async(function () use (&$promise, $func) { - call_user_func($func); - // 移除协程id及promise - unset($this->_promise[spl_object_hash($promise)]); - }); - return spl_object_hash($promise); - } - /** @inheritdoc */ - public function query(string $id): mixed - { - return $this->_promise[$id] ?? null; + return $this->_promise; } } diff --git a/docs/files/src/Utils/Coroutine/Handlers/SwooleCoroutine.php.txt b/docs/files/src/Utils/Coroutine/Handlers/SwooleCoroutine.php.txt index f863082..9519c9e 100644 --- a/docs/files/src/Utils/Coroutine/Handlers/SwooleCoroutine.php.txt +++ b/docs/files/src/Utils/Coroutine/Handlers/SwooleCoroutine.php.txt @@ -12,36 +12,32 @@ use Swoole\Coroutine; class SwooleCoroutine implements CoroutineInterface { /** - * @var array + * @var int|null */ - protected array $_promise; + protected ?int $_id; - /** @inheritdoc */ - public function __construct() + /** @inheritdoc + * @param \Closure $func + */ + public function __construct(\Closure $func) { - $this->_promise = []; + while (1) { + if ($res = Coroutine::create($func)) { + $this->_id = $res; + break; + } + } } /** @inheritdoc */ public function __destruct() { - $this->_promise = []; - } - - /** @inheritdoc */ - public function create(\Closure $func): string - { - while (1) { - if ($coroutine = Coroutine::create($func)) { - break; - } - } - return (string)$coroutine; + $this->_id = null; } /** @inheritdoc */ - public function query(string $id): bool + public function origin(): ?int { - return false; + return $this->_id; } } diff --git a/docs/files/src/Utils/Coroutine/Handlers/SwowCoroutine.php.txt b/docs/files/src/Utils/Coroutine/Handlers/SwowCoroutine.php.txt index c32cbf5..5aa7952 100644 --- a/docs/files/src/Utils/Coroutine/Handlers/SwowCoroutine.php.txt +++ b/docs/files/src/Utils/Coroutine/Handlers/SwowCoroutine.php.txt @@ -12,32 +12,27 @@ use Swow\Coroutine; class SwowCoroutine implements CoroutineInterface { /** - * @var array + * @var null|Coroutine */ - protected array $_promise; + protected ?Coroutine $_coroutine; - /** @inheritdoc */ - public function __construct() + /** @inheritdoc + * @param \Closure $func + */ + public function __construct(\Closure $func) { - $this->_promise = []; + $this->_coroutine = Coroutine::run($func); } /** @inheritdoc */ public function __destruct() { - $this->_promise = []; - } - - /** @inheritdoc */ - public function create(\Closure $func): string - { - $coroutine = Coroutine::run($func); - return (string)$coroutine->getId(); + $this->_coroutine = null; } /** @inheritdoc */ - public function query(string $id): ?Coroutine + public function origin(): ?Coroutine { - return Coroutine::get((int)$id); + return $this->_coroutine; } } diff --git a/docs/files/src/Utils/WaitGroup/Handlers/RippleWaitGroup.php.txt b/docs/files/src/Utils/WaitGroup/Handlers/RippleWaitGroup.php.txt index 8ae926e..09df81a 100644 --- a/docs/files/src/Utils/WaitGroup/Handlers/RippleWaitGroup.php.txt +++ b/docs/files/src/Utils/WaitGroup/Handlers/RippleWaitGroup.php.txt @@ -21,7 +21,17 @@ class RippleWaitGroup implements WaitGroupInterface /** @inheritdoc */ public function __destruct() { - $this->_count = 0; + try { + $count = $this->count(); + if ($count > 0) { + foreach (range(1, $count) as $ignored) { + $this->done(); + } + } + } catch (\Throwable) {} finally { + $this->_count = 0; + } + } /** @inheritdoc */ diff --git a/docs/files/src/Utils/WaitGroup/Handlers/SwooleWaitGroup.php.txt b/docs/files/src/Utils/WaitGroup/Handlers/SwooleWaitGroup.php.txt index 52c163c..ecf5afe 100644 --- a/docs/files/src/Utils/WaitGroup/Handlers/SwooleWaitGroup.php.txt +++ b/docs/files/src/Utils/WaitGroup/Handlers/SwooleWaitGroup.php.txt @@ -7,48 +7,65 @@ declare(strict_types=1); namespace Workbunny\WebmanCoroutine\Utils\WaitGroup\Handlers; -use Swoole\Coroutine\WaitGroup; - class SwooleWaitGroup implements WaitGroupInterface { - /** @var WaitGroup|null */ - protected ?WaitGroup $_waitGroup; + /** @var int */ + protected int $_count; /** @inheritdoc */ public function __construct() { - $this->_waitGroup = new WaitGroup(); + $this->_count = 0; } /** @inheritdoc */ public function __destruct() { - $this->_waitGroup = null; + try { + $count = $this->count(); + if ($count > 0) { + foreach (range(1, $count) as $ignored) { + $this->done(); + } + } + } catch (\Throwable) {} finally { + $this->_count = 0; + } + } /** @inheritdoc */ public function add(int $delta = 1): bool { - $this->_waitGroup->add($delta); + $this->_count ++; return true; } /** @inheritdoc */ public function done(): bool { - $this->_waitGroup->done(); + $this->_count --; return true; } /** @inheritdoc */ public function count(): int { - return $this->_waitGroup->count(); + return $this->_count; } /** @inheritdoc */ public function wait(int $timeout = -1): void { - $this->_waitGroup->wait($timeout); + $time = time(); + while (1) { + if ($timeout > 0 and time() - $time >= $timeout) { + return; + } + if ($this->_count <= 0) { + return; + } + sleep(max($timeout, 0)); + } } } diff --git a/docs/files/src/Utils/WaitGroup/Handlers/SwowWaitGroup.php.txt b/docs/files/src/Utils/WaitGroup/Handlers/SwowWaitGroup.php.txt index e261aaa..6955713 100644 --- a/docs/files/src/Utils/WaitGroup/Handlers/SwowWaitGroup.php.txt +++ b/docs/files/src/Utils/WaitGroup/Handlers/SwowWaitGroup.php.txt @@ -11,8 +11,8 @@ use Swow\Sync\WaitGroup; class SwowWaitGroup implements WaitGroupInterface { - /** @var WaitGroup|null */ - protected ?WaitGroup $_waitGroup; + /** @var WaitGroup */ + protected WaitGroup $_waitGroup; /** @var int 计数 */ protected int $_count; @@ -27,8 +27,16 @@ class SwowWaitGroup implements WaitGroupInterface /** @inheritdoc */ public function __destruct() { - $this->_waitGroup = null; - $this->_count = 0; + try { + $count = $this->count(); + if ($count > 0) { + foreach (range(1, $count) as $ignored) { + $this->done(); + } + } + } catch (\Throwable) {} finally { + $this->_count = 0; + } } /** @inheritdoc */ diff --git a/docs/files/src/Utils/WaitGroup/WaitGroup.php.txt b/docs/files/src/Utils/WaitGroup/WaitGroup.php.txt index 425fd5f..99eb131 100644 --- a/docs/files/src/Utils/WaitGroup/WaitGroup.php.txt +++ b/docs/files/src/Utils/WaitGroup/WaitGroup.php.txt @@ -26,9 +26,9 @@ class WaitGroup use RegisterMethods; /** - * @var WaitGroupInterface + * @var WaitGroupInterface|null */ - protected WaitGroupInterface $_interface; + protected ?WaitGroupInterface $_interface; /** * @var string[] @@ -49,6 +49,14 @@ class WaitGroup $this->_interface = new (self::$_handlers[Factory::getCurrentEventLoop()] ?? DefaultWaitGroup::class)(); } + /** + * 析构方法 + */ + public function __destruct() + { + $this->_interface = null; + } + /** @inheritdoc */ public static function registerVerify(mixed $value): false|string { diff --git a/docs/files/src/Utils/Worker/AbstractWorker.php.txt b/docs/files/src/Utils/Worker/AbstractWorker.php.txt index decc353..97727e2 100644 --- a/docs/files/src/Utils/Worker/AbstractWorker.php.txt +++ b/docs/files/src/Utils/Worker/AbstractWorker.php.txt @@ -7,45 +7,19 @@ declare(strict_types=1); namespace Workbunny\WebmanCoroutine\Utils\Worker; -use Workbunny\WebmanCoroutine\Utils\Coroutine\Coroutine; +use Workbunny\WebmanCoroutine\Factory; +use Workbunny\WebmanCoroutine\Handlers\HandlerInterface; use Workerman\Worker; abstract class AbstractWorker extends Worker { - /** - * 协程组件 - * - * @var Coroutine - */ - protected Coroutine $_coroutine; - - /** - * 构造 - * - * @param string $socket_name - * @param array $context_option - */ - public function __construct(string $socket_name = '', array $context_option = array()) - { - // 初始化协程组件 - $this->_coroutine = new Coroutine(); - // 父类构造 - parent::__construct($socket_name, $context_option); - } - - /** - * 获取协程组件 - * - * @return Coroutine - */ - public function getCoroutine(): Coroutine - { - return $this->_coroutine; - } - /** @inheritdoc */ public function run(): void { + // 加载环境 + /** @var HandlerInterface $handler */ + $handler = Factory::getCurrentHandler(); + $handler::initEnv(); // 加载__runInit__开头的初始化方法 $traits = class_uses($this, false); foreach ($traits as $trait) { diff --git a/docs/files/src/Utils/Worker/ServerMethods.php.txt b/docs/files/src/Utils/Worker/ServerMethods.php.txt index ef28ede..cdd13a5 100644 --- a/docs/files/src/Utils/Worker/ServerMethods.php.txt +++ b/docs/files/src/Utils/Worker/ServerMethods.php.txt @@ -8,6 +8,7 @@ declare(strict_types=1); namespace Workbunny\WebmanCoroutine\Utils\Worker; use Workbunny\WebmanCoroutine\Utils\Channel\Channel; +use Workbunny\WebmanCoroutine\Utils\Coroutine\Coroutine; use Workbunny\WebmanCoroutine\Utils\WaitGroup\WaitGroup; use Workerman\Connection\ConnectionInterface; @@ -164,7 +165,7 @@ trait ServerMethods $this->onConnect = function (ConnectionInterface $connection) use ($connectionCoroutine) { // 协程化连接创建 if ($connectionCoroutine) { - $this->getCoroutine()->create(function () use ($connection) { + new Coroutine(function () use ($connection) { call_user_func($this->getParentOnConnect(), $connection); }); } else { @@ -182,7 +183,7 @@ trait ServerMethods $this->onClose = function (ConnectionInterface $connection) use ($connectionCoroutine) { // 协程化连接关闭 if ($connectionCoroutine) { - $this->getCoroutine()->create(function () use ($connection) { + new Coroutine(function () use ($connection) { call_user_func($this->getParentOnClose(), $connection); }); } else { @@ -204,10 +205,11 @@ trait ServerMethods ]); $waitGroup = new WaitGroup(); // 消费者消费 - foreach (range(1, $this->getConnectionConsumerCount()) as $ignored) { + $count = max(1, $this->getConnectionConsumerCount()); + foreach (range(1, $count) as $ignored) { $waitGroup->add(); // 协程创建 - $this->getCoroutine()->create(function () use ($channel, $waitGroup) { + new Coroutine(function () use ($channel, $waitGroup) { while (true) { // 通道为空或者关闭时退出协程 if ( diff --git a/docs/files/src/Utils/Worker/WorkerMethods.php.txt b/docs/files/src/Utils/Worker/WorkerMethods.php.txt index 1803155..a2d2304 100644 --- a/docs/files/src/Utils/Worker/WorkerMethods.php.txt +++ b/docs/files/src/Utils/Worker/WorkerMethods.php.txt @@ -7,6 +7,7 @@ declare(strict_types=1); namespace Workbunny\WebmanCoroutine\Utils\Worker; +use Workbunny\WebmanCoroutine\Utils\Coroutine\Coroutine; use Workbunny\WebmanCoroutine\Utils\WaitGroup\WaitGroup; trait WorkerMethods @@ -48,7 +49,7 @@ trait WorkerMethods $this->onWorkerStart = function (\Workerman\Worker $worker) { $waitGroup = new WaitGroup(); $waitGroup->add(1); - $this->getCoroutine()->create(function () use ($worker, $waitGroup) { + new Coroutine(function () use ($worker, $waitGroup) { call_user_func($this->getParentOnWorkerStart(), $worker); $waitGroup->done(); }); @@ -59,7 +60,7 @@ trait WorkerMethods $this->onWorkerStop = function (\Workerman\Worker $worker) { $waitGroup = new WaitGroup(); $waitGroup->add(1); - $this->getCoroutine()->create(function () use ($worker, $waitGroup) { + new Coroutine(function () use ($worker, $waitGroup) { call_user_func($this->getParentOnWorkerStop(), $worker); $waitGroup->done(); }); diff --git a/docs/files/src/Utils/tools.php.txt b/docs/files/src/Utils/tools.php.txt index 81e2aa4..9192590 100644 --- a/docs/files/src/Utils/tools.php.txt +++ b/docs/files/src/Utils/tools.php.txt @@ -5,6 +5,8 @@ */ declare(strict_types=1); +require_once __DIR__ . '/../../vendor/autoload.php'; + /** * @param string $targetClass * @param string $sourceClass diff --git a/docs/files/src/helpers.php.txt b/docs/files/src/helpers.php.txt index c0ef76d..e7e924b 100644 --- a/docs/files/src/helpers.php.txt +++ b/docs/files/src/helpers.php.txt @@ -15,11 +15,8 @@ namespace Workbunny\WebmanCoroutine; */ function event_loop(?string $expectEventLoopClass = null): string { - return $expectEventLoopClass - // 如果传入期待值,则会对期待值判定 - ? Factory::get($expectEventLoopClass, true, true) - // 否则根据环境自动判定 - : Factory::find(true); + Factory::init($expectEventLoopClass); + return Factory::getCurrentEventLoop(); } /** diff --git a/docs/index.html b/docs/index.html index 4d5879d..ed7e469 100644 --- a/docs/index.html +++ b/docs/index.html @@ -157,9 +157,9 @@

      diff --git a/docs/indices/files.html b/docs/indices/files.html index 6f3563d..3f34aaf 100644 --- a/docs/indices/files.html +++ b/docs/indices/files.html @@ -102,11 +102,7 @@

      C

    • ChannelInterface.php
    • Coroutine.php
    • CoroutineInterface.php
    • -
    • CoroutineServerInterface.php
    • -
    • CoroutineServerMethods.php
    • CoroutineWebServer.php
    • -
    • CoroutineWorkerInterface.php
    • -
    • CoroutineWorkerMethods.php

    D

      diff --git a/docs/js/searchIndex.js b/docs/js/searchIndex.js index 7cb0716..c44a005 100644 --- a/docs/js/searchIndex.js +++ b/docs/js/searchIndex.js @@ -1,36 +1,6 @@ Search.appendIndex( [ { - "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineServerInterface", - "name": "CoroutineServerInterface", - "summary": "\u81EA\u5B9A\u4E49\u670D\u52A1\u4EE3\u7406\u534F\u7A0B\u5316\u63A5\u53E3", - "url": "classes/Workbunny-WebmanCoroutine-CoroutineServerInterface.html" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineServerInterface\u003A\u003AonMessage\u0028\u0029", - "name": "onMessage", - "summary": "\u5B50\u7C7B\u9700\u8981\u5C06onMessage\u91CD\u5199\n\u7236\u7C7BonMessage\u8BF7\u4F7F\u7528\u0040link\u0020parentOnMessage\u0020\u5B9E\u73B0", - "url": "classes/Workbunny-WebmanCoroutine-CoroutineServerInterface.html#method_onMessage" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineServerInterface\u003A\u003AparentOnMessage\u0028\u0029", - "name": "parentOnMessage", - "summary": "\u7236\u7C7BonMessage\u5C06\u4F1A\u88AB\u91CD\u5199\uFF0C\u5C06\u7236\u7C7B\u7684onMessage\u65B9\u6CD5\u4EE3\u7406\u5230\u5B50\u7C7B", - "url": "classes/Workbunny-WebmanCoroutine-CoroutineServerInterface.html#method_parentOnMessage" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineServerMethods", - "name": "CoroutineServerMethods", - "summary": "", - "url": "classes/Workbunny-WebmanCoroutine-CoroutineServerMethods.html" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineServerMethods\u003A\u003AonMessage\u0028\u0029", - "name": "onMessage", - "summary": "\u91CD\u5199onMessage\u65B9\u6CD5", - "url": "classes/Workbunny-WebmanCoroutine-CoroutineServerMethods.html#method_onMessage" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineServerMethods\u003A\u003AparentOnMessage\u0028\u0029", - "name": "parentOnMessage", - "summary": "\u7236\u7C7BonMessage\u4EE3\u7406", - "url": "classes/Workbunny-WebmanCoroutine-CoroutineServerMethods.html#method_parentOnMessage" - }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineWebServer", "name": "CoroutineWebServer", "summary": "\u534F\u7A0B\u5316web\u670D\u52A1\u8FDB\u7A0B", @@ -60,36 +30,6 @@ Search.appendIndex( "name": "onMessage", "summary": "", "url": "classes/Workbunny-WebmanCoroutine-CoroutineWebServer.html#method_onMessage" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineWorkerInterface", - "name": "CoroutineWorkerInterface", - "summary": "\u81EA\u5B9A\u4E49worker\u4EE3\u7406\u534F\u7A0B\u5316\u63A5\u53E3", - "url": "classes/Workbunny-WebmanCoroutine-CoroutineWorkerInterface.html" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineWorkerInterface\u003A\u003AonWorkerStart\u0028\u0029", - "name": "onWorkerStart", - "summary": "\u5B50\u7C7B\u9700\u8981\u5C06onWorkerStart\u91CD\u5199\n\u7236\u7C7BonWorkerStart\u8BF7\u4F7F\u7528\u0040link\u0020parentOnWorkerStart\u0020\u5B9E\u73B0", - "url": "classes/Workbunny-WebmanCoroutine-CoroutineWorkerInterface.html#method_onWorkerStart" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineWorkerInterface\u003A\u003AparentOnWorkerStart\u0028\u0029", - "name": "parentOnWorkerStart", - "summary": "\u7236\u7C7BonWorkerStart\u5C06\u4F1A\u88AB\u91CD\u5199\uFF0C\u5C06\u7236\u7C7B\u7684onWorkerStart\u65B9\u6CD5\u4EE3\u7406\u5230\u5B50\u7C7B", - "url": "classes/Workbunny-WebmanCoroutine-CoroutineWorkerInterface.html#method_parentOnWorkerStart" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineWorkerMethods", - "name": "CoroutineWorkerMethods", - "summary": "", - "url": "classes/Workbunny-WebmanCoroutine-CoroutineWorkerMethods.html" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineWorkerMethods\u003A\u003AonWorkerStart\u0028\u0029", - "name": "onWorkerStart", - "summary": "\u91CD\u5199onWorkerStart\u65B9\u6CD5", - "url": "classes/Workbunny-WebmanCoroutine-CoroutineWorkerMethods.html#method_onWorkerStart" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\CoroutineWorkerMethods\u003A\u003AparentOnWorkerStart\u0028\u0029", - "name": "parentOnWorkerStart", - "summary": "\u7236\u7C7BonMessage\u4EE3\u7406", - "url": "classes/Workbunny-WebmanCoroutine-CoroutineWorkerMethods.html#method_parentOnWorkerStart" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Events\\SwooleEvent", "name": "SwooleEvent", @@ -198,7 +138,7 @@ Search.appendIndex( }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Factory\u003A\u003AgetCurrentEventLoop\u0028\u0029", "name": "getCurrentEventLoop", - "summary": "", + "summary": "\u83B7\u53D6\u5F53\u524D\u4E8B\u4EF6\u5FAA\u73AF", "url": "classes/Workbunny-WebmanCoroutine-Factory.html#method_getCurrentEventLoop" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Factory\u003A\u003AgetCurrentHandler\u0028\u0029", @@ -225,26 +165,11 @@ Search.appendIndex( "name": "get", "summary": "\u6839\u636E\u4E8B\u4EF6\u5FAA\u73AF\u7C7B\u83B7\u53D6\u5BF9\u5E94\u5904\u7406\u5668", "url": "classes/Workbunny-WebmanCoroutine-Factory.html#method_get" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Factory\u003A\u003Afind\u0028\u0029", - "name": "find", - "summary": "\u6839\u636E\u5F53\u524D\u73AF\u5883\u83B7\u53D6\u53EF\u7528\u7684\u5904\u7406\u5668", - "url": "classes/Workbunny-WebmanCoroutine-Factory.html#method_find" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Factory\u003A\u003Ainit\u0028\u0029", "name": "init", "summary": "\u521D\u59CB\u5316", "url": "classes/Workbunny-WebmanCoroutine-Factory.html#method_init" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Factory\u003A\u003Arun\u0028\u0029", - "name": "run", - "summary": "\u6839\u636E\u5F53\u524D\u73AF\u5883\u8FD0\u884C\u5904\u7406\u5668", - "url": "classes/Workbunny-WebmanCoroutine-Factory.html#method_run" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Factory\u003A\u003Astart\u0028\u0029", - "name": "start", - "summary": "\u6839\u636E\u5F53\u524D\u73AF\u5883\u8FD0\u884C\u5904\u7406\u5668", - "url": "classes/Workbunny-WebmanCoroutine-Factory.html#method_start" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Factory\u003A\u003AWORKERMAN_SWOW", "name": "WORKERMAN_SWOW", @@ -286,30 +211,10 @@ Search.appendIndex( "summary": "default\u0020handler\u6C38\u8FDC\u8FD4\u56DEtrue", "url": "classes/Workbunny-WebmanCoroutine-Handlers-DefaultHandler.html#method_isAvailable" }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\DefaultHandler\u003A\u003AonMessage\u0028\u0029", - "name": "onMessage", - "summary": "default\u0020handler\u4E0D\u4F1A\u521B\u5EFA\u534F\u7A0B", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-DefaultHandler.html#method_onMessage" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\DefaultHandler\u003A\u003AonWorkerStart\u0028\u0029", - "name": "onWorkerStart", - "summary": "default\u0020handler\u4E0D\u4F1A\u521B\u5EFA\u534F\u7A0B", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-DefaultHandler.html#method_onWorkerStart" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\DefaultHandler\u003A\u003AcoroutineCreate\u0028\u0029", - "name": "coroutineCreate", - "summary": "default\u0020handler\u4E0D\u4F1A\u521B\u5EFA\u534F\u7A0B", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-DefaultHandler.html#method_coroutineCreate" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\DefaultHandler\u003A\u003AwaitGroupCreate\u0028\u0029", - "name": "waitGroupCreate", - "summary": "default\u0020handler\u4E0D\u4F1A\u521B\u5EFAwaitGroup", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-DefaultHandler.html#method_waitGroupCreate" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\DefaultHandler\u003A\u003AwaitGroupWait\u0028\u0029", - "name": "waitGroupWait", - "summary": "default\u0020handler\u4E0D\u4F1A\u7B49\u5F85waitGroup", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-DefaultHandler.html#method_waitGroupWait" + "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\DefaultHandler\u003A\u003AinitEnv\u0028\u0029", + "name": "initEnv", + "summary": "default\u0020handler\u65E0\u9700\u521D\u59CB\u5316", + "url": "classes/Workbunny-WebmanCoroutine-Handlers-DefaultHandler.html#method_initEnv" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\HandlerInterface", "name": "HandlerInterface", @@ -321,30 +226,10 @@ Search.appendIndex( "summary": "\u7528\u4E8E\u5224\u65AD\u5F53\u524D\u73AF\u5883\u662F\u5426\u53EF\u7528", "url": "classes/Workbunny-WebmanCoroutine-Handlers-HandlerInterface.html#method_isAvailable" }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\HandlerInterface\u003A\u003AonMessage\u0028\u0029", - "name": "onMessage", - "summary": "\u6267\u884C\u534F\u7A0B\u5904\u7406", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-HandlerInterface.html#method_onMessage" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\HandlerInterface\u003A\u003AonWorkerStart\u0028\u0029", - "name": "onWorkerStart", - "summary": "\u6267\u884C\u534F\u7A0B\u5904\u7406", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-HandlerInterface.html#method_onWorkerStart" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\HandlerInterface\u003A\u003AcoroutineCreate\u0028\u0029", - "name": "coroutineCreate", - "summary": "\u521B\u5EFA\u4E00\u4E2A\u534F\u7A0B", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-HandlerInterface.html#method_coroutineCreate" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\HandlerInterface\u003A\u003AwaitGroupCreate\u0028\u0029", - "name": "waitGroupCreate", - "summary": "\u521B\u5EFA\u4E00\u4E2AwaitGroup", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-HandlerInterface.html#method_waitGroupCreate" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\HandlerInterface\u003A\u003AwaitGroupWait\u0028\u0029", - "name": "waitGroupWait", - "summary": "\u963B\u585E\u7B49\u5F85\u4E00\u4E2AwaitGroup\u5B8C\u6210", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-HandlerInterface.html#method_waitGroupWait" + "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\HandlerInterface\u003A\u003AinitEnv\u0028\u0029", + "name": "initEnv", + "summary": "\u7528\u4E8E\u73AF\u5883\u52A0\u8F7D\u521D\u59CB\u5316", + "url": "classes/Workbunny-WebmanCoroutine-Handlers-HandlerInterface.html#method_initEnv" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\RippleHandler", "name": "RippleHandler", @@ -356,30 +241,10 @@ Search.appendIndex( "summary": "\u7528\u4E8E\u5224\u65AD\u5F53\u524D\u73AF\u5883\u662F\u5426\u53EF\u7528", "url": "classes/Workbunny-WebmanCoroutine-Handlers-RippleHandler.html#method_isAvailable" }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\RippleHandler\u003A\u003AonMessage\u0028\u0029", - "name": "onMessage", - "summary": "\u6267\u884C\u534F\u7A0B\u5904\u7406", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-RippleHandler.html#method_onMessage" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\RippleHandler\u003A\u003AonWorkerStart\u0028\u0029", - "name": "onWorkerStart", - "summary": "\u6267\u884C\u534F\u7A0B\u5904\u7406", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-RippleHandler.html#method_onWorkerStart" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\RippleHandler\u003A\u003AcoroutineCreate\u0028\u0029", - "name": "coroutineCreate", - "summary": "\u521B\u5EFA\u4E00\u4E2A\u534F\u7A0B", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-RippleHandler.html#method_coroutineCreate" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\RippleHandler\u003A\u003AwaitGroupCreate\u0028\u0029", - "name": "waitGroupCreate", - "summary": "\u521B\u5EFA\u4E00\u4E2AwaitGroup", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-RippleHandler.html#method_waitGroupCreate" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\RippleHandler\u003A\u003AwaitGroupWait\u0028\u0029", - "name": "waitGroupWait", - "summary": "\u963B\u585E\u7B49\u5F85\u4E00\u4E2AwaitGroup\u5B8C\u6210", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-RippleHandler.html#method_waitGroupWait" + "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\RippleHandler\u003A\u003AinitEnv\u0028\u0029", + "name": "initEnv", + "summary": "ripple\u0020handler\u65E0\u9700\u521D\u59CB\u5316", + "url": "classes/Workbunny-WebmanCoroutine-Handlers-RippleHandler.html#method_initEnv" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwooleHandler", "name": "SwooleHandler", @@ -391,30 +256,10 @@ Search.appendIndex( "summary": "\u7528\u4E8E\u5224\u65AD\u5F53\u524D\u73AF\u5883\u662F\u5426\u53EF\u7528", "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwooleHandler.html#method_isAvailable" }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwooleHandler\u003A\u003AonMessage\u0028\u0029", - "name": "onMessage", - "summary": "\u6267\u884C\u534F\u7A0B\u5904\u7406", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwooleHandler.html#method_onMessage" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwooleHandler\u003A\u003AonWorkerStart\u0028\u0029", - "name": "onWorkerStart", - "summary": "\u6267\u884C\u534F\u7A0B\u5904\u7406", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwooleHandler.html#method_onWorkerStart" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwooleHandler\u003A\u003AcoroutineCreate\u0028\u0029", - "name": "coroutineCreate", - "summary": "\u521B\u5EFA\u4E00\u4E2A\u534F\u7A0B", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwooleHandler.html#method_coroutineCreate" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwooleHandler\u003A\u003AwaitGroupCreate\u0028\u0029", - "name": "waitGroupCreate", - "summary": "\u521B\u5EFA\u4E00\u4E2AwaitGroup", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwooleHandler.html#method_waitGroupCreate" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwooleHandler\u003A\u003AwaitGroupWait\u0028\u0029", - "name": "waitGroupWait", - "summary": "\u963B\u585E\u7B49\u5F85\u4E00\u4E2AwaitGroup\u5B8C\u6210", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwooleHandler.html#method_waitGroupWait" + "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwooleHandler\u003A\u003AinitEnv\u0028\u0029", + "name": "initEnv", + "summary": "\u7528\u4E8E\u73AF\u5883\u52A0\u8F7D\u521D\u59CB\u5316", + "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwooleHandler.html#method_initEnv" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwooleWorkerman5Handler", "name": "SwooleWorkerman5Handler", @@ -436,30 +281,10 @@ Search.appendIndex( "summary": "\u7528\u4E8E\u5224\u65AD\u5F53\u524D\u73AF\u5883\u662F\u5426\u53EF\u7528", "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwowHandler.html#method_isAvailable" }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwowHandler\u003A\u003AonMessage\u0028\u0029", - "name": "onMessage", - "summary": "\u6267\u884C\u534F\u7A0B\u5904\u7406", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwowHandler.html#method_onMessage" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwowHandler\u003A\u003AonWorkerStart\u0028\u0029", - "name": "onWorkerStart", - "summary": "\u6267\u884C\u534F\u7A0B\u5904\u7406", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwowHandler.html#method_onWorkerStart" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwowHandler\u003A\u003AcoroutineCreate\u0028\u0029", - "name": "coroutineCreate", - "summary": "\u521B\u5EFA\u4E00\u4E2A\u534F\u7A0B", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwowHandler.html#method_coroutineCreate" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwowHandler\u003A\u003AwaitGroupCreate\u0028\u0029", - "name": "waitGroupCreate", - "summary": "\u521B\u5EFA\u4E00\u4E2AwaitGroup", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwowHandler.html#method_waitGroupCreate" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwowHandler\u003A\u003AwaitGroupWait\u0028\u0029", - "name": "waitGroupWait", - "summary": "\u963B\u585E\u7B49\u5F85\u4E00\u4E2AwaitGroup\u5B8C\u6210", - "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwowHandler.html#method_waitGroupWait" + "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwowHandler\u003A\u003AinitEnv\u0028\u0029", + "name": "initEnv", + "summary": "swow\u0020handler\u65E0\u9700\u521D\u59CB\u5316", + "url": "classes/Workbunny-WebmanCoroutine-Handlers-SwowHandler.html#method_initEnv" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Handlers\\SwowWorkerman5Handler", "name": "SwowWorkerman5Handler", @@ -490,6 +315,11 @@ Search.appendIndex( "name": "__construct", "summary": "\u6784\u9020\u65B9\u6CD5", "url": "classes/Workbunny-WebmanCoroutine-Utils-Channel-Channel.html#method___construct" + }, { + "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Channel\\Channel\u003A\u003A__destruct\u0028\u0029", + "name": "__destruct", + "summary": "\u6790\u6784\u65B9\u6CD5", + "url": "classes/Workbunny-WebmanCoroutine-Utils-Channel-Channel.html#method___destruct" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Channel\\Channel\u003A\u003AregisterVerify\u0028\u0029", "name": "registerVerify", @@ -738,8 +568,13 @@ Search.appendIndex( }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Coroutine\u003A\u003A__construct\u0028\u0029", "name": "__construct", - "summary": "\u6784\u9020\u65B9\u6CD5", + "summary": "", "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Coroutine.html#method___construct" + }, { + "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Coroutine\u003A\u003A__destruct\u0028\u0029", + "name": "__destruct", + "summary": "", + "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Coroutine.html#method___destruct" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Coroutine\u003A\u003AregisterVerify\u0028\u0029", "name": "registerVerify", @@ -763,23 +598,18 @@ Search.appendIndex( }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\CoroutineInterface\u003A\u003A__construct\u0028\u0029", "name": "__construct", - "summary": "\u521D\u59CB\u5316", + "summary": "\u521B\u5EFA\u534F\u7A0B", "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-CoroutineInterface.html#method___construct" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\CoroutineInterface\u003A\u003A__destruct\u0028\u0029", "name": "__destruct", - "summary": "\u9500\u6BC1", + "summary": "\u9500\u6BC1\u534F\u7A0B", "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-CoroutineInterface.html#method___destruct" }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\CoroutineInterface\u003A\u003Acreate\u0028\u0029", - "name": "create", - "summary": "\u521B\u5EFA\u4E00\u4E2A\u534F\u7A0B", - "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-CoroutineInterface.html#method_create" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\CoroutineInterface\u003A\u003Aquery\u0028\u0029", - "name": "query", - "summary": "\u83B7\u53D6\u534F\u7A0B\u5BF9\u8C61\uFF0C\u90E8\u5206\u5B9E\u73B0\u4E0D\u652F\u6301", - "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-CoroutineInterface.html#method_query" + "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\CoroutineInterface\u003A\u003Aorigin\u0028\u0029", + "name": "origin", + "summary": "\u83B7\u53D6\u534F\u7A0B\u539F\u59CB\u8FD4\u56DE", + "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-CoroutineInterface.html#method_origin" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\DefaultCoroutine", "name": "DefaultCoroutine", @@ -788,23 +618,18 @@ Search.appendIndex( }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\DefaultCoroutine\u003A\u003A__construct\u0028\u0029", "name": "__construct", - "summary": "\u521D\u59CB\u5316", + "summary": "\u521B\u5EFA\u534F\u7A0B", "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-DefaultCoroutine.html#method___construct" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\DefaultCoroutine\u003A\u003A__destruct\u0028\u0029", "name": "__destruct", - "summary": "\u9500\u6BC1", + "summary": "\u9500\u6BC1\u534F\u7A0B", "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-DefaultCoroutine.html#method___destruct" }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\DefaultCoroutine\u003A\u003Acreate\u0028\u0029", - "name": "create", - "summary": "\u521B\u5EFA\u4E00\u4E2A\u534F\u7A0B", - "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-DefaultCoroutine.html#method_create" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\DefaultCoroutine\u003A\u003Aquery\u0028\u0029", - "name": "query", - "summary": "\u83B7\u53D6\u534F\u7A0B\u5BF9\u8C61\uFF0C\u90E8\u5206\u5B9E\u73B0\u4E0D\u652F\u6301", - "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-DefaultCoroutine.html#method_query" + "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\DefaultCoroutine\u003A\u003Aorigin\u0028\u0029", + "name": "origin", + "summary": "\u83B7\u53D6\u534F\u7A0B\u539F\u59CB\u8FD4\u56DE", + "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-DefaultCoroutine.html#method_origin" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\RippleCoroutine", "name": "RippleCoroutine", @@ -813,23 +638,18 @@ Search.appendIndex( }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\RippleCoroutine\u003A\u003A__construct\u0028\u0029", "name": "__construct", - "summary": "\u521D\u59CB\u5316", + "summary": "\u521B\u5EFA\u534F\u7A0B", "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-RippleCoroutine.html#method___construct" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\RippleCoroutine\u003A\u003A__destruct\u0028\u0029", "name": "__destruct", - "summary": "\u9500\u6BC1", + "summary": "\u9500\u6BC1\u534F\u7A0B", "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-RippleCoroutine.html#method___destruct" }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\RippleCoroutine\u003A\u003Acreate\u0028\u0029", - "name": "create", - "summary": "\u521B\u5EFA\u4E00\u4E2A\u534F\u7A0B", - "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-RippleCoroutine.html#method_create" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\RippleCoroutine\u003A\u003Aquery\u0028\u0029", - "name": "query", - "summary": "\u83B7\u53D6\u534F\u7A0B\u5BF9\u8C61\uFF0C\u90E8\u5206\u5B9E\u73B0\u4E0D\u652F\u6301", - "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-RippleCoroutine.html#method_query" + "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\RippleCoroutine\u003A\u003Aorigin\u0028\u0029", + "name": "origin", + "summary": "\u83B7\u53D6\u534F\u7A0B\u539F\u59CB\u8FD4\u56DE", + "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-RippleCoroutine.html#method_origin" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\SwooleCoroutine", "name": "SwooleCoroutine", @@ -838,23 +658,18 @@ Search.appendIndex( }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\SwooleCoroutine\u003A\u003A__construct\u0028\u0029", "name": "__construct", - "summary": "\u521D\u59CB\u5316", + "summary": "\u521B\u5EFA\u534F\u7A0B", "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwooleCoroutine.html#method___construct" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\SwooleCoroutine\u003A\u003A__destruct\u0028\u0029", "name": "__destruct", - "summary": "\u9500\u6BC1", + "summary": "\u9500\u6BC1\u534F\u7A0B", "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwooleCoroutine.html#method___destruct" }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\SwooleCoroutine\u003A\u003Acreate\u0028\u0029", - "name": "create", - "summary": "\u521B\u5EFA\u4E00\u4E2A\u534F\u7A0B", - "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwooleCoroutine.html#method_create" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\SwooleCoroutine\u003A\u003Aquery\u0028\u0029", - "name": "query", - "summary": "\u83B7\u53D6\u534F\u7A0B\u5BF9\u8C61\uFF0C\u90E8\u5206\u5B9E\u73B0\u4E0D\u652F\u6301", - "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwooleCoroutine.html#method_query" + "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\SwooleCoroutine\u003A\u003Aorigin\u0028\u0029", + "name": "origin", + "summary": "\u83B7\u53D6\u534F\u7A0B\u539F\u59CB\u8FD4\u56DE", + "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwooleCoroutine.html#method_origin" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\SwowCoroutine", "name": "SwowCoroutine", @@ -863,23 +678,18 @@ Search.appendIndex( }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\SwowCoroutine\u003A\u003A__construct\u0028\u0029", "name": "__construct", - "summary": "\u521D\u59CB\u5316", + "summary": "\u521B\u5EFA\u534F\u7A0B", "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwowCoroutine.html#method___construct" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\SwowCoroutine\u003A\u003A__destruct\u0028\u0029", "name": "__destruct", - "summary": "\u9500\u6BC1", + "summary": "\u9500\u6BC1\u534F\u7A0B", "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwowCoroutine.html#method___destruct" }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\SwowCoroutine\u003A\u003Acreate\u0028\u0029", - "name": "create", - "summary": "\u521B\u5EFA\u4E00\u4E2A\u534F\u7A0B", - "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwowCoroutine.html#method_create" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\SwowCoroutine\u003A\u003Aquery\u0028\u0029", - "name": "query", - "summary": "\u83B7\u53D6\u534F\u7A0B\u5BF9\u8C61\uFF0C\u90E8\u5206\u5B9E\u73B0\u4E0D\u652F\u6301", - "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwowCoroutine.html#method_query" + "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Coroutine\\Handlers\\SwowCoroutine\u003A\u003Aorigin\u0028\u0029", + "name": "origin", + "summary": "\u83B7\u53D6\u534F\u7A0B\u539F\u59CB\u8FD4\u56DE", + "url": "classes/Workbunny-WebmanCoroutine-Utils-Coroutine-Handlers-SwowCoroutine.html#method_origin" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\RegisterMethods", "name": "RegisterMethods", @@ -1100,6 +910,11 @@ Search.appendIndex( "name": "__construct", "summary": "\u6784\u9020\u65B9\u6CD5", "url": "classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-WaitGroup.html#method___construct" + }, { + "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\WaitGroup\\WaitGroup\u003A\u003A__destruct\u0028\u0029", + "name": "__destruct", + "summary": "\u6790\u6784\u65B9\u6CD5", + "url": "classes/Workbunny-WebmanCoroutine-Utils-WaitGroup-WaitGroup.html#method___destruct" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\WaitGroup\\WaitGroup\u003A\u003AregisterVerify\u0028\u0029", "name": "registerVerify", @@ -1120,16 +935,6 @@ Search.appendIndex( "name": "AbstractWorker", "summary": "", "url": "classes/Workbunny-WebmanCoroutine-Utils-Worker-AbstractWorker.html" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Worker\\AbstractWorker\u003A\u003A__construct\u0028\u0029", - "name": "__construct", - "summary": "\u6784\u9020", - "url": "classes/Workbunny-WebmanCoroutine-Utils-Worker-AbstractWorker.html#method___construct" - }, { - "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Worker\\AbstractWorker\u003A\u003AgetCoroutine\u0028\u0029", - "name": "getCoroutine", - "summary": "\u83B7\u53D6\u534F\u7A0B\u7EC4\u4EF6", - "url": "classes/Workbunny-WebmanCoroutine-Utils-Worker-AbstractWorker.html#method_getCoroutine" }, { "fqsen": "\\Workbunny\\WebmanCoroutine\\Utils\\Worker\\AbstractWorker\u003A\u003Arun\u0028\u0029", "name": "run", diff --git a/docs/namespaces/default.html b/docs/namespaces/default.html index 055affd..7f429a9 100644 --- a/docs/namespaces/default.html +++ b/docs/namespaces/default.html @@ -152,9 +152,9 @@

      diff --git a/docs/namespaces/workbunny-webmancoroutine.html b/docs/namespaces/workbunny-webmancoroutine.html index 2c158e9..8a0b067 100644 --- a/docs/namespaces/workbunny-webmancoroutine.html +++ b/docs/namespaces/workbunny-webmancoroutine.html @@ -117,13 +117,6 @@

      Utils
      -

      - Interfaces - - -

      -
      -
      CoroutineServerInterface
      自定义服务代理协程化接口
      CoroutineWorkerInterface
      自定义worker代理协程化接口

      Classes @@ -133,13 +126,6 @@

      CoroutineWebServer
      协程化web服务进程
      Factory
      工厂化启动器
      -

      - Traits - - -

      -
      -
      CoroutineServerMethods
      CoroutineWorkerMethods
      @@ -232,9 +218,9 @@

      判断是否composer安装了指定包

      @@ -375,10 +361,8 @@

      Return values
    • Table Of Contents
    • diff --git a/docs/packages/WebmanCoroutine.html b/docs/packages/WebmanCoroutine.html index 561403c..c10fb1b 100644 --- a/docs/packages/WebmanCoroutine.html +++ b/docs/packages/WebmanCoroutine.html @@ -111,7 +111,7 @@

      -
      CoroutineServerInterface
      自定义服务代理协程化接口
      CoroutineWorkerInterface
      自定义worker代理协程化接口
      HandlerInterface
      协程处理器接口
      ChannelInterface
      CoroutineInterface
      WaitGroupInterface
      +
      HandlerInterface
      协程处理器接口
      ChannelInterface
      CoroutineInterface
      WaitGroupInterface

      Classes @@ -127,7 +127,7 @@

      -
      CoroutineServerMethods
      CoroutineWorkerMethods
      RegisterMethods
      ServerMethods
      WorkerMethods
      +
      RegisterMethods
      ServerMethods
      WorkerMethods
      @@ -226,9 +226,9 @@

      判断是否composer安装了指定包

      @@ -273,9 +273,9 @@