lLen($key); return $result; } /** * 插入数据 * @param $data * @return int */ public static function push($data) { $key = self::getKey(); $result = self::getConnection(true)->rPush($key, $data); return $result; } /** * 取出数据 * @return string */ public static function pop() { $key = self::getKey(); $result = self::getConnection(true)->lPop($key); return $result; } /** * 获取连接池 * @param bool $isMaster * @return \Redis */ protected static function getConnection($isMaster = false) { $class = get_called_class(); $configClass = $class::CONFIG_CLASS; $redis = new \Heanup\Frame\Library\Redis($configClass); $connection = $redis->getConnection($isMaster); return $connection; } }