Predis\Connection\Aggregate\RedisCluster::writeRequest PHP Метод

writeRequest() публичный Метод

public writeRequest ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface
    public function writeRequest(CommandInterface $command)
    {
        $this->retryCommandOnFailure($command, __FUNCTION__);
    }

Usage Example

 /**
  * @group disconnected
  */
 public function testWritesCommandToCorrectConnection()
 {
     $command = Profile\Factory::getDefault()->createCommand('get', array('node:1001'));
     $connection1 = $this->getMockConnection('tcp://127.0.0.1:6379');
     $connection1->expects($this->once())->method('writeRequest')->with($command);
     $connection2 = $this->getMockConnection('tcp://127.0.0.1:6380');
     $connection2->expects($this->never())->method('writeRequest');
     $cluster = new RedisCluster(new Connection\Factory());
     $cluster->useClusterSlots(false);
     $cluster->add($connection1);
     $cluster->add($connection2);
     $cluster->writeRequest($command);
 }