Skip to content

Instantly share code, notes, and snippets.

@178inaba
Last active August 28, 2015 06:40
Show Gist options
  • Select an option

  • Save 178inaba/4a23f33e1e00701c1c6f to your computer and use it in GitHub Desktop.

Select an option

Save 178inaba/4a23f33e1e00701c1c6f to your computer and use it in GitHub Desktop.
use jedis 2.4.2 and playframework 2.4
JedisPool pool = new JedisPool(new JedisPoolConfig(), "localhost");
for (int i = 0; i < 50000; i++) {
Jedis redis = null;
try {
redis = pool.getResource();
redis.set("key-" + i, "value-" + i);
Logger.debug("get " + redis.get("key-" + i));
} finally {
if (redis != null) {
//redis.close();
pool.returnResource(redis);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment