This commit is contained in:
2023-04-01 23:57:36 +08:00
parent 881c1b3d49
commit d57c803a53
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -176,7 +176,7 @@ class CoroutineServer implements ServerInterface
$this->onTasker();
foreach ($this->servers as $server) {
Coroutine::create(function () use ($server) {
Coroutine::create(static function () use ($server) {
$server->start();
});
}
@@ -216,7 +216,7 @@ class CoroutineServer implements ServerInterface
$this->channel = new Coroutine\Channel($config[Constant::OPTION_TASK_WORKER_NUM]);
for ($i = 0; $i < $config[Constant::OPTION_TASK_WORKER_NUM]; $i++) {
Coroutine::create(fn() => $this->taskRunner($i, $taskEvents, $finishEvents));
Coroutine::create(static fn() => $this->taskRunner($i, $taskEvents, $finishEvents));
}
}