/**
  * @param Connection[] $connections
  * @throws \Plista\Core\Redis\Exception when no connections are passed in
  */
 public function __construct(array $connections)
 {
     parent::__construct($connections);
     // we have to empty the connections here again, so we can refill them later in addConnection()
     $this->connections = new ConnectionSet(array());
     // get an instance of the ConsistentHashing class from the extension and use $this as fallback
     $this->consistentHashing = class_exists('\\ConsistentHashing') ? new \ConsistentHashing() : $this;
     foreach ($connections as $connId => $conn) {
         $this->addConnection($conn, $connId);
     }
 }
예제 #2
0
 /**
  * @param bool $force
  */
 public function disconnect($force = false)
 {
     parent::disconnect($force);
     $this->clearConnectionParameters();
 }
예제 #3
0
 /**
  * @param Connection $readConnection
  * @param Connection $writeConnection
  */
 public function __construct(Connection $readConnection, Connection $writeConnection)
 {
     // TODO: make both connections optional, so this wrapper can be used as a filter as well
     parent::__construct(array('r' => $readConnection, 'w' => $writeConnection));
     $this->commandHelper = new CommandHelper();
 }