public function addWaitingWorker($id)
    {
        if ($id instanceof Worker) {
            $id = $id->getId();
        }

        if (!isset($this->workerList[$id])) {
            throw new \Exception('Trying to add non existent worker to the queue.');
        }
        $worker = $this->workerList[$id];

        $this->ready = true;

        /*
         * Only add the worker to the end of the wait list if it is not
         * already there.
         */
        if (!isset($this->waitingList[$id])) {
            $this->waitingList[$id] = $worker;
        }

        return $this;
    }