Ejemplo n.º 1
0
 public function connect()
 {
     try {
         $this->node = $this->cluster->getRandomNode();
         $this->connection = $this->node->getConnection();
     } catch (ConnectionException $e) {
         $this->connect();
     }
 }
Ejemplo n.º 2
0
 public function connect($connect_timeout_ms)
 {
     try {
         $this->node = $this->cluster->getRandomNode();
         $this->connection = $this->node->getConnection($connect_timeout_ms);
     } catch (ConnectionException $e) {
         error_log($e->getMessage());
         $this->connect($connect_timeout_ms);
     }
 }