redisurl
redisurl copied to clipboard
Adds NewPool() and NewPoolWithURL()
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.