public function connect() { try { $this->node = $this->cluster->getRandomNode(); $this->connection = $this->node->getConnection(); } catch (ConnectionException $e) { $this->connect(); } }
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); } }