public function getConnectionByKey($key, $cb = null) { if (is_object($key)) { return $key->onConnected($cb); } srand(crc32($key)); $addr = array_rand($this->servers); srand(); return $this->getConnection($addr, $cb); }