Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RoundRobinPool ¶
type RoundRobinPool struct {
// contains filtered or unexported fields
}
RoundRobinPool is a round-robin redis client pool for connecting multiple codis proxies based on zookeeper-go and redis-go.
func NewRoundRobinPool ¶
func NewRoundRobinPool(zkConn *zk.Conn, zkProxyDir string, options redis.Options) (*RoundRobinPool, error)
NewRoundRobinPool return a round-robin redis client pool specified by zk client and redis options.
func (*RoundRobinPool) Close ¶
func (p *RoundRobinPool) Close()
Close closes the pool, releasing all resources except zookeeper client.
func (*RoundRobinPool) GetClient ¶
func (p *RoundRobinPool) GetClient() *redis.Client
GetClient can get a redis client from pool with round-robin policy. It's safe for concurrent use by multiple goroutines.
Click to show internal directories.
Click to hide internal directories.