protected function checkIfAllReady()
{
$this->checkQueue();
if ($this->resultsNum >= $this->jobsNum) {
$this->jobs = [];
$this->state = self::STATE_DONE;
foreach ($this->listeners as $cb) {
$cb($this);
}
if (!$this->keep && $this->resultsNum >= $this->jobsNum) {
$this->cleanup();
}
}
}