public function checkQueue()
{
if ($this->backlog !== null) {
while (!$this->backlog->isEmpty()) {
if ($this->maxConcurrency !== -1 && $this->jobsNum - $this->resultsNum > $this->maxConcurrency) {
return;
}
list($name, $cb) = $this->backlog->shift();
$this->addJob($name, $cb);
}
}
if ($this->more !== null) {
$this->more();
}
}