Predis\Pipeline\Pipeline::executeCommand PHP Method

executeCommand() public method

Queues a command instance into the pipeline buffer.
public executeCommand ( Predis\Command\CommandInterface $command )
$command Predis\Command\CommandInterface Command instance to be queued in the buffer.
    public function executeCommand(CommandInterface $command)
    {
        $this->recordCommand($command);
        return $this;
    }

Usage Example

コード例 #1
0
 /**
  * @group disconnected
  */
 public function testExecuteCommandDoesNotSendCommandsWithoutExecute()
 {
     $profile = Profile\Factory::getDefault();
     $connection = $this->getMock('Predis\\Connection\\NodeConnectionInterface');
     $connection->expects($this->never())->method('writeRequest');
     $connection->expects($this->never())->method('readResponse');
     $pipeline = new Pipeline(new Client($connection));
     $pipeline->executeCommand($profile->createCommand('echo', array('one')));
     $pipeline->executeCommand($profile->createCommand('echo', array('two')));
     $pipeline->executeCommand($profile->createCommand('echo', array('three')));
 }