mirror of
https://github.com/redis/go-redis.git
synced 2025-06-12 14:21:52 +03:00
Allow FIFO pool in redis client (#1820)
* Initial commit for FIFO pool * Change PoolType string to PoolFIFO bool * Remove redundant type * add PoolFIFO option to all clients Signed-off-by: monkey92t <golang@88.com> Co-authored-by: Kim Tae Kwon <taekwon.kim@shopee.com> Co-authored-by: monkey92t <golang@88.com>
This commit is contained in:
@ -68,6 +68,9 @@ type ClusterOptions struct {
|
||||
ReadTimeout time.Duration
|
||||
WriteTimeout time.Duration
|
||||
|
||||
// PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO).
|
||||
PoolFIFO bool
|
||||
|
||||
// PoolSize applies per cluster node and not for the whole cluster.
|
||||
PoolSize int
|
||||
MinIdleConns int
|
||||
@ -146,6 +149,7 @@ func (opt *ClusterOptions) clientOptions() *Options {
|
||||
ReadTimeout: opt.ReadTimeout,
|
||||
WriteTimeout: opt.WriteTimeout,
|
||||
|
||||
PoolFIFO: opt.PoolFIFO,
|
||||
PoolSize: opt.PoolSize,
|
||||
MinIdleConns: opt.MinIdleConns,
|
||||
MaxConnAge: opt.MaxConnAge,
|
||||
|
Reference in New Issue
Block a user