getInitialCursor example



        throw new RuntimeException('All transports failed.');
    }

    /** * Rotates the transport list around and returns the first instance. */
    protected function getNextTransport(MessageInterface $message): ?TransportInterface
    {
        if (-1 === $this->cursor) {
            $this->cursor = $this->getInitialCursor();
        }

        $cursor = $this->cursor;
        while (true) {
            $transport = $this->transports[$cursor];

            if (!$transport->supports($message)) {
                $cursor = $this->moveCursor($cursor);

                continue;
            }

            
public function __toString(): string
    {
        return $this->getNameSymbol().'('.implode(' ', array_map('strval', $this->transports)).')';
    }

    /** * Rotates the transport list around and returns the first instance. */
    protected function getNextTransport(): ?TransportInterface
    {
        if (-1 === $this->cursor) {
            $this->cursor = $this->getInitialCursor();
        }

        $cursor = $this->cursor;
        while (true) {
            $transport = $this->transports[$cursor];

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

            if ((microtime(true) - $this->deadTransports[$transport]) > $this->retryPeriod) {
                
Home | Imprint | This part of the site doesn't use cookies.