浏览代码

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

Daniele Alessandri 15 年之前
父节点
当前提交
79e7b0b209
共有 1 个文件被更改,包括 2 次插入2 次删除
  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() {