Revert "redis pipeline"

This reverts commit 471aecd708.
This commit is contained in:
xiefan
2015-11-13 08:10:33 +08:00
parent 471aecd708
commit d2396f9d20
2 changed files with 0 additions and 59 deletions

View File

@@ -4,7 +4,6 @@ local socketchannel = require "socketchannel"
local table = table
local string = string
local assert = assert
local redis = {}
local command = {}
@@ -162,27 +161,6 @@ function command:sismember(key, value)
return fd:request(compose_message ("SISMEMBER", {key, value}), read_boolean)
end
function command:pipeline(ops)
assert(#ops > 0, "pipeline is null")
local fd = self[1]
local cmds = {}
for _, cmd in ipairs(ops) do
assert(#cmd >= 2, "pipeline error, the params length is less than 2")
table.insert(cmds, compose_message(string.upper(cmd[1]), {cmd[2], cmd[3], cmd[4]}))
end
return fd:request(table.concat(cmds, "\r\n"), function (fd)
local result = {}
for i=1, #ops do
local ok, out = read_response(fd)
table.insert(result, {ok = ok, out = out})
end
return true, result
end)
end
--- watch mode
local watch = {}