This commit is contained in:
2020-09-02 18:36:53 +08:00
parent 2ac024d493
commit 0f63888022
2 changed files with 8 additions and 9 deletions
+1 -6
View File
@@ -71,12 +71,7 @@ trait Server
$settings = $this->setting;
if (($taskNumber = $settings['task_worker_num'] ?? 0) > 0) {
$this->on('finish', $this->createHandler('finish'));
$callback = $this->createHandler('task');
if ($settings['task_enable_coroutine'] ?? false) {
$this->on('task', [$callback, 'onContinueTask']);
} else {
$this->on('task', [$callback, 'onTask']);
}
$this->on('task', $this->createHandler('task'));
}
}