Redix.pipeline and MULTI/EXEC currently returns a list when executing multiple commands but only a single answer when executing a single command. I found this quite surprising, ex:
commands = [
["SET", "pipe", "10"],
["INCR", "pipe"],
["GET", "pipe"]
]
Redix.pipeline(conn, commands)
=> {:ok, ["OK", 11, "11"]}
Redix.pipeline(conn, [["SET", "pipe_single", "10"]])
=> {:ok, "OK"}
Expected {:ok, ["OK"]} for last command.
Same for MULTI/EXEC:
Redix.command(conn, ["MULTI"])
=> {:ok, "OK"}
Redix.command(conn, ["INCR", "multifoo"])
=> {:ok, "QUEUED"}
Redix.command(conn, ["INCR", "multibar"])
=> {:ok, "QUEUED"}
Redix.command(conn, ["INCRBY", "multifoo", 4])
=> {:ok, "QUEUED"}
Redix.command(c, ["EXEC"])
=> {:ok, [1, 1, 5]}
Redix.command(conn, ["MULTI"])
=> {:ok, "OK"}
Redix.command(conn, ["SET", "multifoo", "10"])
=> {:ok, "QUEUED"}
Redix.command(c, ["EXEC"])
=> {:ok, "OK"}
Expected {:ok, ["OK"]} for last command.
Redix.pipeline and MULTI/EXEC currently returns a list when executing multiple commands but only a single answer when executing a single command. I found this quite surprising, ex:
Expected {:ok, ["OK"]} for last command.
Same for MULTI/EXEC:
Expected {:ok, ["OK"]} for last command.