tmp connect

This commit is contained in:
jerry
2021-03-22 07:44:11 +08:00
parent b6d1f724e9
commit 0ff4e52ed3
26 changed files with 812 additions and 212 deletions

View File

@@ -18,6 +18,7 @@ class LightCacheInside
self::createTable("wait_api", 3, 65536);
self::createTable("connect", 3, 64); //用于存单机器人模式下的机器人fd的
self::createTable("static_route", 64, 256);//用于存储
self::createTable("light_array", 8, 512, 0.6);
} catch (ZMException $e) {
return false;
} //用于存协程等待的状态内容的
@@ -59,10 +60,11 @@ class LightCacheInside
* @param $name
* @param $size
* @param $str_size
* @param int $conflict_proportion
* @throws ZMException
*/
private static function createTable($name, $size, $str_size) {
self::$kv_table[$name] = new Table($size, 0);
private static function createTable($name, $size, $str_size, $conflict_proportion = 0) {
self::$kv_table[$name] = new Table($size, $conflict_proportion);
self::$kv_table[$name]->column("value", Table::TYPE_STRING, $str_size);
$r = self::$kv_table[$name]->create();
if ($r === false) throw new ZMException("内存不足,创建静态表失败!");