There was an error while loading. Please reload this page.
1 parent 3730fa6 commit a9d7686Copy full SHA for a9d7686
redis/pipeline.java.snippet
@@ -0,0 +1,22 @@
1
+import redis.clients.jedis.Jedis;
2
+import redis.clients.jedis.Pipeline;
3
+import redis.clients.jedis.Response;
4
+import redis.clients.jedis.Transaction;
5
+import redis.clients.jedis.exceptions.JedisDataException;
6
+
7
8
+...
9
10
+ Pipeline p = jedis.pipelined();
11
12
+ Response<Long> hsetResponse = p.hset(statusKey, "available", "true");
13
+ Response<Long> expireResponse = p.expire(statusKey, 1000);
14
+ Response<Long> saddResponse = p.sadd(availableKey,
15
+ String.valueOf(siteId));
16
17
+ p.sync();
18
19
+ assertThat(hsetResponse.get(), is(1L));
20
+ assertThat(expireResponse.get(), is(1L));
21
+ assertThat(saddResponse.get(), is(1L));
22
0 commit comments