正在显示
1 个修改的文件
包含
3 行增加
和
0 行删除
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | namespace Jiaoyin; | 2 | namespace Jiaoyin; |
| 3 | //格式化输出 | 3 | //格式化输出 |
| 4 | use Swoole\Process; | 4 | use Swoole\Process; |
| 5 | +use Swoole\Event; | ||
| 5 | 6 | ||
| 6 | function output(): void | 7 | function output(): void |
| 7 | { | 8 | { |
| @@ -78,9 +79,11 @@ function runAsDaemon($callback,$isDaemon=true): void | @@ -78,9 +79,11 @@ function runAsDaemon($callback,$isDaemon=true): void | ||
| 78 | Process::daemon(); | 79 | Process::daemon(); |
| 79 | $process = new Process(function ()use ($callback){ | 80 | $process = new Process(function ()use ($callback){ |
| 80 | call_user_func($callback); | 81 | call_user_func($callback); |
| 82 | + Event::wait(); | ||
| 81 | }); | 83 | }); |
| 82 | $process->start(); | 84 | $process->start(); |
| 83 | }else{ | 85 | }else{ |
| 84 | call_user_func($callback); | 86 | call_user_func($callback); |
| 87 | + Event::wait(); | ||
| 85 | } | 88 | } |
| 86 | } | 89 | } |
-
请 注册 或 登录 后发表评论