src/Pool.php
protected function removeWorker(\CharlotteDunois\Phoebe\Worker $worker) {
        $msgs = $worker->getMessages();
        while($message = $msgs->shift()) {
            $this->handleMessage($worker, $message);
        }
        
        unset($this->workers[$worker->id]);
        $this->busyWorkers->delete($worker);
        
        $size = $this->freeWorkers->count();
        for($i = 0; $i < $size; $i++) {
            $free = $this->freeWorkers->dequeue();
            if($free === $worker) {
                break;
            }
            
            $this->freeWorkers->enqueue($free);
        }
    }
protected function removeWorker(\CharlotteDunois\Phoebe\Worker $worker) {
        $msgs = $worker->getMessages();
        while($message = $msgs->shift()) {
            $this->handleMessage($worker, $message);
        }
        
        unset($this->workers[$worker->id]);
        $this->busyWorkers->delete($worker);
        
        $size = $this->freeWorkers->count();
        for($i = 0; $i < $size; $i++) {
            $free = $this->freeWorkers->dequeue();
            if($free === $worker) {
                break;
            }
            
            $this->freeWorkers->enqueue($free);
        }
    }
Removes a worker correctly.
@param \CharlotteDunois\Phoebe\Worker  $worker
@return void