Browse Source

Predis\ConnectionCluster now accepts an instance of Predis\Utilities\IRing as an optional parameter.

Daniele Alessandri 15 years ago
parent
commit
79e7b0b209
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lib/Predis.php

+ 2 - 2
lib/Predis.php

@@ -961,9 +961,9 @@ class Connection implements IConnection {
 class ConnectionCluster implements IConnection, \IteratorAggregate {
     private $_pool, $_ring;
 
-    public function __construct() {
+    public function __construct(Utilities\IRing $ring = null) {
         $this->_pool = array();
-        $this->_ring = new Utilities\HashRing();
+        $this->_ring = $ring ?: new Utilities\HashRing();
     }
 
     public function isConnected() {