private function push(Worker $worker)
{
if (!$this->workers->contains($worker)) {
throw new InvalidArgumentError('The provided worker was not part of this queue.');
}
if (0 === ($this->workers[$worker] -= 1)) {
// Worker is completely idle, remove from busy queue and add to idle queue.
foreach ($this->busyQueue as $key => $busy) {
if ($busy === $worker) {
unset($this->busyQueue[$key]);
break;
}
}
$this->idleWorkers->push($worker);
}
}