Conditions | 2 |
Paths | 2 |
Total Lines | 27 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function worker() |
||
33 | { |
||
34 | $process = $this->nodejs(); |
||
35 | $process->disableOutput(); |
||
36 | $process->start(); |
||
37 | |||
38 | // Save node proccess pid |
||
39 | $this->addPid($process->getPid()); |
||
40 | |||
41 | // // Init connection for each channel |
||
42 | // foreach (Broadcast::channels() as $channel) { |
||
43 | // var_dump($channel); |
||
44 | // Broadcast::publish($channel, ['name' => __CLASS__]); |
||
45 | // } |
||
46 | // $process->setTimeout(360000); |
||
47 | // $process->setIdleTimeout(360000); |
||
48 | // $process->wait(function ($type, $buffer) { |
||
49 | // if (Process::ERR === $type) { |
||
50 | // echo 'ERR > ' . $buffer; |
||
51 | // } else { |
||
52 | // echo 'OUT > ' . $buffer; |
||
53 | // } |
||
54 | // }); |
||
55 | while ($process->isRunning()) { |
||
56 | $this->predis(); |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 |