作者 karlet

feat:runAsDaemon 增加 Event::wait();

... ... @@ -2,6 +2,7 @@
namespace Jiaoyin;
//格式化输出
use Swoole\Process;
use Swoole\Event;
function output(): void
{
... ... @@ -78,9 +79,11 @@ function runAsDaemon($callback,$isDaemon=true): void
Process::daemon();
$process = new Process(function ()use ($callback){
call_user_func($callback);
Event::wait();
});
$process->start();
}else{
call_user_func($callback);
Event::wait();
}
}
... ...