redisurl icon indicating copy to clipboard operation
redisurl copied to clipboard

Adds NewPool() and NewPoolWithURL()

Open pote opened this issue 11 years ago • 0 comments

This pull request adds convenience methods for redigo's connection pools, the way redigo itself handles it is really cumbersome.

pool, _ := NewPool(3, 200, "240s") // Args are "maxIdle", "maxActive" and "idleTimeout"

c := pool.Get()
defer c.Close()
pong, err := redis.String(c.Do("PING"))

Unrelated: is there any particular reason for the test to be in it's own package? Feel free to revert that part, I changed it because I prefer to keep them in the package itself and this way doesn't play along with my Go setup.

pote avatar Oct 18 '14 23:10 pote