protected function getNextTransport(): ?TransportInterface
    {
        $cursor = $this->cursor;
        while (true) {
            $transport = $this->transports[$cursor];

            if (!$this->isTransportDead($transport)) {
                break;
            }

            if ((microtime(true) - $this->deadTransports[$transport]) > $this->retryPeriod) {
                $this->deadTransports->detach($transport);

                break;
            }

            if ($this->cursor === $cursor = $this->moveCursor($cursor)) {
                return null;
            }
        }

        $this->cursor = $this->moveCursor($cursor);

        return $transport;
    }
protected function getNextTransport(): ?TransportInterface
    {
        $cursor = $this->cursor;
        while (true) {
            $transport = $this->transports[$cursor];

            if (!$this->isTransportDead($transport)) {
                break;
            }

            if ((microtime(true) - $this->deadTransports[$transport]) > $this->retryPeriod) {
                $this->deadTransports->detach($transport);

                break;
            }

            if ($this->cursor === $cursor = $this->moveCursor($cursor)) {
                return null;
            }
        }

        $this->cursor = $this->moveCursor($cursor);

        return $transport;
    }
protected function getNextTransport ( ) : ? TransportInterface { $ cursor = $ this -> cursor ; while ( true ) { $ transport = $ this -> transports [ $ cursor ] ; if ( ! $ this -> isTransportDead ( $ transport ) ) { break ; } if ( ( microtime ( true ) - $ this -> deadTransports [ $ transport ] ) > $ this -> retryPeriod ) { $ this -> deadTransports -> detach ( $ transport ) ; break ; } if ( $ this -> cursor === $ cursor = $ this -> moveCursor ( $ cursor ) ) { return null ; } } $ this -> cursor = $ this -> moveCursor ( $ cursor ) ; return $ transport ; }
Rotates the transport list around and returns the first instance.
Rotates the transport list around and returns the first instance .