public function run()
{
$this->shutdown = false;
while ($this->shutdown === false) {
$this->synchronized(function () {
while ($this->logStream->count() > 0) {
$chunk = $this->logStream->shift();
if ($this->write) {
$this->logResource = file_put_contents($this->logFile, $chunk, FILE_APPEND);
}
}
$this->wait(200000);
});
}
if ($this->logStream->count() > 0) {
while ($this->logStream->count() > 0) {
$chunk = $this->logStream->shift();
if ($this->write) {
$this->logResource = file_put_contents($this->logFile, $chunk, FILE_APPEND);
}
}
}
}