@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | if ($pid) { |
141 | 141 | // owner |
142 | - $this->log->info('pid: ' . getmypid()); |
|
142 | + $this->log->info('pid: '.getmypid()); |
|
143 | 143 | |
144 | 144 | return $this->masterPid; |
145 | 145 | } elseif ($pid === -1) { |
@@ -147,19 +147,19 @@ discard block |
||
147 | 147 | } else { |
148 | 148 | // master |
149 | 149 | $taskQueue = new TaskQueue($this->ownerPid); |
150 | - $this->log->info('pid: ' . $this->masterPid); |
|
150 | + $this->log->info('pid: '.$this->masterPid); |
|
151 | 151 | |
152 | 152 | $log = $this->log; |
153 | 153 | foreach ($this->signals as $sig) { |
154 | - $this->pcntl->signal($sig, function ($sig) use ($log) { |
|
155 | - $log->info('received signal: ' . $sig); |
|
154 | + $this->pcntl->signal($sig, function($sig) use ($log) { |
|
155 | + $log->info('received signal: '.$sig); |
|
156 | 156 | exit; |
157 | 157 | }); |
158 | 158 | } |
159 | 159 | $workerCount = 0; |
160 | 160 | |
161 | 161 | while ($task = $taskQueue->dequeue()) { |
162 | - $this->log->info('dequeued task #' . $taskQueue->dequeuedCount()); |
|
162 | + $this->log->info('dequeued task #'.$taskQueue->dequeuedCount()); |
|
163 | 163 | if ($workerCount >= $this->concurrency) { |
164 | 164 | $status = null; |
165 | 165 | $this->pcntl->waitpid(-1, $status); |
@@ -190,10 +190,10 @@ discard block |
||
190 | 190 | |
191 | 191 | if (getmypid() === $this->masterPid) { |
192 | 192 | // master |
193 | - $this->log->info('forked worker. pid: ' . $fork->getPid()); |
|
193 | + $this->log->info('forked worker. pid: '.$fork->getPid()); |
|
194 | 194 | } else { |
195 | 195 | // worker |
196 | - $this->log->info('has forked. pid: ' . getmypid()); |
|
196 | + $this->log->info('has forked. pid: '.getmypid()); |
|
197 | 197 | // @codeCoverageIgnoreStart |
198 | 198 | |
199 | 199 | foreach ($this->signals as $sig) { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | $resultQueue = new ResultQueue($this->ownerPid); |
204 | 204 | $resultHasQueued = false; |
205 | - register_shutdown_function(function () use (&$resultHasQueued, $fork, $task, $resultQueue) { |
|
205 | + register_shutdown_function(function() use (&$resultHasQueued, $fork, $task, $resultQueue) { |
|
206 | 206 | if (!$resultHasQueued) { |
207 | 207 | $result = new Result(); |
208 | 208 | $result->setError(error_get_last()); |
@@ -246,13 +246,13 @@ discard block |
||
246 | 246 | */ |
247 | 247 | public function sendSignalToMaster($sig = SIGTERM) |
248 | 248 | { |
249 | - $this->log->info('----> sending signal to master. signal: ' . $sig); |
|
249 | + $this->log->info('----> sending signal to master. signal: '.$sig); |
|
250 | 250 | posix_kill($this->masterPid, $sig); |
251 | 251 | $this->log->info('<---- sent signal.'); |
252 | 252 | |
253 | 253 | $status = null; |
254 | 254 | $this->pcntl->waitpid($this->masterPid, $status); |
255 | - $this->log->info('. status: ' . $status); |
|
255 | + $this->log->info('. status: '.$status); |
|
256 | 256 | $this->masterPid = null; |
257 | 257 | } |
258 | 258 |