diff options
author | Gowa2017 <33367355+Gowa2017@users.noreply.github.com> | 2022-01-04 18:22:41 +0800 |
---|---|---|
committer | Gowa2017 <33367355+Gowa2017@users.noreply.github.com> | 2022-01-04 18:22:41 +0800 |
commit | 858a9e21faeabf56d70e30fd9595198c03873501 (patch) | |
tree | 92b64883dd5484d3ecdddf45a3368d830e9ec8a2 /meta/3rd | |
parent | 812587133d9d6e0f70573b52f0b5eda14584c275 (diff) | |
download | lua-language-server-858a9e21faeabf56d70e30fd9595198c03873501.zip |
add redis command mode desc
Diffstat (limited to 'meta/3rd')
-rw-r--r-- | meta/3rd/skynet/library/skynet/db/redis.lua | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/meta/3rd/skynet/library/skynet/db/redis.lua b/meta/3rd/skynet/library/skynet/db/redis.lua index 322bc2f4..c335502a 100644 --- a/meta/3rd/skynet/library/skynet/db/redis.lua +++ b/meta/3rd/skynet/library/skynet/db/redis.lua @@ -9,36 +9,55 @@ local redis = {} ---@field db integer ---@field username? string ----其他指令还可以动态生成 ----更多命令查看 https://www.redis.com.cn/commands.html +---一个 Redis 连接,返回这个 Command 对象。当在此对象上执行指令时,若指令不存在,会在第一次执行的时候构造 +---指令对象的方法。 +---指令的参数的第一个可以是 nil, 也可以是 table,还可以有多个参数。 +---异步形式,底层用 socketchannel 进行通信,这点要注意。 +---更多命令查看 [https://www.redis.com.cn/commands.html](https://www.redis.com.cn/commands.html) +---@see socketchannel +---@class command local command = {} -function command:disconnect() end -function command:exists(k) end -function command:sismember(key, value) end -function command:pipeline(ops, resp) end +function command:disconnect() +end +function command:exists(k) +end +function command:sismember(key, value) +end +function command:pipeline(ops, resp) +end --- watch mode, only can do SUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE, PUNSUBSCRIBE, PING and QUIT command. +--- we can call watch:message in endless loop. +---@class watch local watch = {} -function watch:disconnect() end +function watch:disconnect() +end ---阻塞模式读取消息 -function watch:message() end +function watch:message() +end ---subscribe channel -function watch:subscribe(...) end +function watch:subscribe(...) +end ---pattern subscribe channels -function watch:psubscribe(...) end +function watch:psubscribe(...) +end ---unsubscribe -function watch:unsubscribe(...) end +function watch:unsubscribe(...) +end ---punsubscribe -function watch:punsubscribe(...) end +function watch:punsubscribe(...) +end ---connect to redis server ---@param conf redisconfig ---@return command -function redis.connect(conf) end +function redis.connect(conf) +end ---connect to redis server on watch mode ---@param conf redisconfig ---@return watch -function redis.watch(conf) end +function redis.watch(conf) +end return redis |