Skip to content

Instantly share code, notes, and snippets.

@daemin-hwang
Created December 23, 2015 04:42
Show Gist options
  • Save daemin-hwang/a9bdc3ff9acbc42d3763 to your computer and use it in GitHub Desktop.
Save daemin-hwang/a9bdc3ff9acbc42d3763 to your computer and use it in GitHub Desktop.
Redis PipeLine example
List<Object> result = null;
RedisConnectionFactory conFactory = stringRedisTemplate.getConnectionFactory();
RedisConnection con = RedisConnectionUtils.bindConnection(conFactory);
try {
con.openPipeline();
try {
Iterator<String> it = usersId.iterator();
while ( it.hasNext() ) {
String userId = (String)it.next();
stringRedisTemplate.boundHashOps(QUEUE_NAME_USER_STATUS).get(userId);
stringRedisTemplate.boundHashOps(QUEUE_NAME_USER_MYSTATUS).get(userId);
stringRedisTemplate.boundHashOps(QUEUE_NAME_USER_LOGINDEVICE).get(userId);
stringRedisTemplate.boundHashOps(QUEUE_NAME_USER_IPLISTENSS).get(userId);
}
} finally {
result = con.closePipeline();
}
} finally {
RedisConnectionUtils.unbindConnection(conFactory);
}
//출처 :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment