Set dependency to Response when multi in pipeline and build dependency
first if Response's dependency found and not built * there's some dependency with exec response and command responses within multi * if command responses's get() called before exec response's build(), it calls exec response's build() first * unit test included
This commit is contained in:
@@ -251,6 +251,27 @@ public class PipeliningTest extends Assert {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void multiWithSync() {
|
||||
jedis.set("foo", "314");
|
||||
jedis.set("bar", "foo");
|
||||
jedis.set("hello", "world");
|
||||
Pipeline p = jedis.pipelined();
|
||||
Response<String> r1 = p.get("bar");
|
||||
p.multi();
|
||||
Response<String> r2 = p.get("foo");
|
||||
p.exec();
|
||||
Response<String> r3 = p.get("hello");
|
||||
p.sync();
|
||||
|
||||
// before multi
|
||||
assertEquals("foo", r1.get());
|
||||
// It should be readable whether exec's response was built or not
|
||||
assertEquals("314", r2.get());
|
||||
// after multi
|
||||
assertEquals("world", r3.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDiscardInPipeline() {
|
||||
Pipeline pipeline = jedis.pipelined();
|
||||
|
||||
Reference in New Issue
Block a user