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

disconnect() public method

public disconnect ( )
    public function disconnect()
    {
        foreach ($this->pool as $connection) {
            $connection->disconnect();
        }
    }

Usage Example

 /**
  * @group disconnected
  */
 public function testDisconnectForcesAllConnectionsToDisconnect()
 {
     $connection1 = $this->getMockConnection();
     $connection1->expects($this->once())->method('disconnect');
     $connection2 = $this->getMockConnection();
     $connection2->expects($this->once())->method('disconnect');
     $cluster = new PredisCluster();
     $cluster->add($connection1);
     $cluster->add($connection2);
     $cluster->disconnect();
 }