This commit is contained in:
as2252258@163.com
2021-03-20 03:35:44 +08:00
parent 3fbf782f41
commit 631c66874f
+16 -2
View File
@@ -35,12 +35,26 @@ class CrontabProcess extends Process
Coroutine\go(function () { Coroutine\go(function () {
$this->waitGroup(); $this->waitGroup();
}); });
while (true) { $this->readByWorker($process);
}
/**
* @param $process
*/
private function readByWorker($process)
{
$this->channel->push($process->read()); $this->channel->push($process->read());
}
Coroutine::sleep(0.01);
$this->readByWorker($process);
} }
/**
* @throws \Exception
*/
private function waitGroup() private function waitGroup()
{ {
try { try {