Exemple #1
0
  private Object execute(RedisCallback callback) {
    try (Jedis jedis = pool.getResource()) {

      Optional<Object> optional = callback.doWithRedis(jedis);

      return optional.orElse(null);
    }
  }
 private Object execute(RedisCallback callback) {
   Jedis jedis = pool.getResource();
   try {
     return callback.doWithRedis(jedis);
   } finally {
     jedis.close();
   }
 }