旧版数据交换 使用示例

以下功能仅在 1200 之前版本的中控版本可以使用

--引入中控库
ts_enterprise_lib = require("ts_enterprise_lib")
assert(ts_enterprise_lib,"无法引入企业专用库")
local redis = ts_enterprise_lib.redis
assert(redis,"无法引入 redis 库")
local red = redis:new()
red:set_timeout(5) -- 5 sec
assert(red:connect())
assert(red:set("dog", "an animal"))
local ret,msg = red:get("dog")
if ret then
    nLog("dog is "..ret)
else
    nLog("redis get error"..msg)
end
assert(red:set("params", {aaa=111,bbb=222}))
local params,msg = red:get("params")
if params then
    nLog("params.aaa="..params.aaa..",params.bbb="..params.bbb)
else
    nLog("redis get params error"..msg)
end
Copyright 北京帮你玩科技有限公司 2020 all right reserved,powered by Gitbook该文章修订时间: 2020-01-01 19:43:49

results matching ""

    No results matching ""