public function nextNode()

in src/NodePool/SimpleNodePool.php [60:81]


    public function nextNode(): Node
    {
        $totNodes = count($this->nodes);
        $dead = 0;

        while ($dead < $totNodes) {
            $next = $this->selector->nextNode();
            if ($next->isAlive()) {
                return $next;
            }
            if ($this->resurrect->ping($next)) {
                $next->markAlive(true);
                return $next;
            }
            $dead++;
        }

        throw new NoNodeAvailableException(sprintf(
            'No alive nodes. All the %d nodes seem to be down.',
            $totNodes
        ));
    }