关于Redis事务和管道之间的区别以及最终如何使用Booksleeve的管道,我有点混淆了.我看到Booksleeve支持Redis 事务功能(MULTI
/ EXEC
),但其API /测试中没有提及流水线功能.但是,在其他实现中很明显,管道和事务之间存在区别,即原子性,如下面的redis-ruby版本所示,但在某些地方,这些术语似乎可以互换使用.
redis-ruby实现:
r.pipelined {
# these commands will be pipelined
r.get("insensitive_key")
}
r.multi {
# these commands will be executed atomically
r.set("sensitive_key")
}
Run Code Online (Sandbox Code Playgroud)
我只是使用MULTI
/ EXEC
而不是它们似乎阻止了所有其他用户,直到交易完成(在我的情况下不是必需的),所以我担心他们的表现.有没有人使用Booksleeve的管道或有任何关于如何实现它们的想法?