public function getFinishedJobs()
    {
        while (count($this->jobs) !== 0) {
            foreach ($this->jobs as $index => $job) {
                if ($job->isFinished()) {
                    unset($this->jobs[$index]);
                    yield $index => $job;
                }
            }
        }
    }