modify
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user