SHARE
TWEET

Untitled

a guest Jan 11th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private def useRedis[T](handler: (Jedis) ⇒ T): T = {
  2.   val jedis = redisPool.getResource
  3.   try {
  4.     handler(jedis)
  5.   } finally {
  6.     redisPool.returnResource(jedis)
  7.   }
  8. }
  9.  
  10.  
  11. // ....
  12.  
  13.  
  14. useRedis { redis ⇒
  15.   redis.hget("namespace", "id123")
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top