Skip to content

Instantly share code, notes, and snippets.

@webdev
Created October 12, 2013 22:07
Show Gist options
  • Save webdev/6955462 to your computer and use it in GitHub Desktop.
Save webdev/6955462 to your computer and use it in GitHub Desktop.
type publisher struct {
connPool redis.Pool
}
WritePool := &redis.Pool{
MaxIdle: 5000,
IdleTimeout: 240 * time.Second,
Dial: func() (redis.Conn, error) {
c, err := redis.Dial("tcp", ":6379")
if err != nil {
return nil, err
}
return c, err
},
TestOnBorrow: func(c redis.Conn, t time.Time) error {
_, err := c.Do("PING")
return err
},
}
p := &publisher{connPool: WritePool}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment