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);
        }
    }
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);
        }
    }
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 ) ; } }
Pushes the worker back into the queue.

@param \Icicle\Concurrent\Worker\Worker $worker

@throws \Icicle\Exception\InvalidArgumentError If the worker was not part of this queue.
Pushes the worker back into the queue .