当然可以保证顺序,否则流水线将毫无用处。您可以随时查看代码。例如,此测试明确假定命令是按顺序执行的:https :
//github.com/redis/redis-
rb/blob/master/test/pipelining_commands_test.rb#L32
def test_bulk_and_multi_bulk_commands_mixed r.pipelined do r.lpush "foo", "s1" r.lpush "foo", "s2" r.mset("baz", "s3", "qux", "s4") end assert_equal 2, r.llen("foo") assert_equal "s2", r.lpop("foo") assert_equal "s1", r.lpop("foo") assert_equal "s3", r.get("baz") assert_equal "s4", r.get("qux")end
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)