src/Pipeline/Pipeline.php
protected function executePipeline(ConnectionInterface $connection, \SplQueue $commands)
    {
        foreach ($commands as $command) {
            $connection->writeRequest($command);
        }

        $responses = array();
        $exceptions = $this->throwServerExceptions();

        while (!$commands->isEmpty()) {
            $command = $commands->dequeue();
            $response = $connection->readResponse($command);

            if (!$response instanceof ResponseInterface) {
                $responses[] = $command->parseResponse($response);
            } elseif ($response instanceof ErrorResponseInterface && $exceptions) {
                $this->exception($connection, $response);
            } else {
                $responses[] = $response;
            }
        }

        return $responses;
    }
protected function executePipeline(ConnectionInterface $connection, \SplQueue $commands)
    {
        foreach ($commands as $command) {
            $connection->writeRequest($command);
        }

        $responses = array();
        $exceptions = $this->throwServerExceptions();

        while (!$commands->isEmpty()) {
            $command = $commands->dequeue();
            $response = $connection->readResponse($command);

            if (!$response instanceof ResponseInterface) {
                $responses[] = $command->parseResponse($response);
            } elseif ($response instanceof ErrorResponseInterface && $exceptions) {
                $this->exception($connection, $response);
            } else {
                $responses[] = $response;
            }
        }

        return $responses;
    }
protected function executePipeline ( ConnectionInterface $ connection , \ SplQueue $ commands ) { foreach ( $ commands as $ command ) { $ connection -> writeRequest ( $ command ) ; } $ responses = array ( ) ; $ exceptions = $ this -> throwServerExceptions ( ) ; while ( ! $ commands -> isEmpty ( ) ) { $ command = $ commands -> dequeue ( ) ; $ response = $ connection -> readResponse ( $ command ) ; if ( ! $ response instanceof ResponseInterface ) { $ responses [ ] = $ command -> parseResponse ( $ response ) ; } elseif ( $ response instanceof ErrorResponseInterface && $ exceptions ) { $ this -> exception ( $ connection , $ response ) ; } else { $ responses [ ] = $ response ; } } return $ responses ; }
Implements the logic to flush the queued commands and read the responses
from the current connection.

@param ConnectionInterface $connection Current connection instance.
@param \SplQueue           $commands   Queued commands.

@return array
Implements the logic to flush the queued commands and read the responses from the current connection .