Last active
August 28, 2015 06:40
-
-
Save 178inaba/4a23f33e1e00701c1c6f to your computer and use it in GitHub Desktop.
use jedis 2.4.2 and playframework 2.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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