flushPipeline() public method

Flushes the buffer holding all of the commands queued so far.
public flushPipeline ( boolean $send = true )
$send boolean Specifies if the commands in the buffer should be sent to Redis.
コード例 #1
0
 /**
  * @group disconnected
  */
 public function testFlushHandlesPartialBuffers()
 {
     $connection = $this->getMock('Predis\\Connection\\NodeConnectionInterface');
     $connection->expects($this->exactly(4))->method('writeRequest');
     $connection->expects($this->exactly(4))->method('readResponse')->will($this->returnCallback($this->getReadCallback()));
     $pipeline = new Pipeline(new Client($connection));
     $pipeline->echo('one');
     $pipeline->echo('two');
     $pipeline->flushPipeline();
     $pipeline->echo('three');
     $pipeline->echo('four');
     $this->assertSame(array('one', 'two', 'three', 'four'), $pipeline->execute());
 }