mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 19:43:09 +00:00
rewrite redis driver , avoid table.concat
This commit is contained in:
@@ -33,29 +33,27 @@ skynet.start(function()
|
||||
do
|
||||
print("test function")
|
||||
local ret = db:pipelining(function (red)
|
||||
red:multi()
|
||||
red:hincrby("hello", 1, 1)
|
||||
red:del("hello")
|
||||
red:hmset("hello", 1, 1, 2, 2, 3, 3)
|
||||
red:hgetall("hello")
|
||||
red:exec()
|
||||
end)
|
||||
|
||||
print(ret[1].out)
|
||||
print(ret[2].out)
|
||||
print(ret[3].out)
|
||||
|
||||
for k, v in pairs(read_table(ret[4].out)) do
|
||||
-- ret is the result of red:exec()
|
||||
for k, v in pairs(read_table(ret[4])) do
|
||||
print(k, v)
|
||||
end
|
||||
end
|
||||
|
||||
do
|
||||
print("test table")
|
||||
local ret = db:pipeline {
|
||||
local ret = db:pipeline({
|
||||
{"hincrby", "hello", 1, 1},
|
||||
{"del", "hello"},
|
||||
{"hmset", "hello", 1, 1, 2, 2, 3, 3},
|
||||
{"hgetall", "hello"},
|
||||
}
|
||||
}, {}) -- offer a {} for result
|
||||
|
||||
print(ret[1].out)
|
||||
print(ret[2].out)
|
||||
|
||||
Reference in New Issue
Block a user