Predis\Connection\Aggregate\PredisCluster::readResponse PHP Method

readResponse() public method

public readResponse ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface
    public function readResponse(CommandInterface $command)
    {
        return $this->getConnection($command)->readResponse($command);
    }

Usage Example

 /**
  * @group disconnected
  */
 public function testReadsCommandFromCorrectConnection()
 {
     $command = Profile\Factory::getDefault()->createCommand('get', array('node02:3212'));
     $connection1 = $this->getMockConnection('tcp://host1:7001');
     $connection1->expects($this->never())->method('readResponse');
     $connection2 = $this->getMockConnection('tcp://host1:7002');
     $connection2->expects($this->once())->method('readResponse')->with($command);
     $cluster = new PredisCluster();
     $cluster->add($connection1);
     $cluster->add($connection2);
     $cluster->readResponse($command);
 }