2017-08-18 20:30:29 +09:00

25 lines
394 B
Go

package redis
import (
"time"
"git.loafle.net/overflow/overflow_gateway_websocket/pubsub"
"github.com/garyburd/redigo/redis"
)
type redisPubSub struct {
pool *redis.Pool
}
func New() pubsub.Pubsub {
r := &redisPubSub{}
r.pool = &redis.Pool{
MaxIdle: 3,
IdleTimeout: 240 * time.Second,
Dial: func() (redis.Conn, error) {
return redis.Dial("tcp", addr)
},
}
return r
}