1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +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:
ktaekwon000
2021-07-16 11:58:01 +08:00
committed by GitHub
parent 247c62ad92
commit ce40cd942a
6 changed files with 38 additions and 4 deletions

View File

@ -78,6 +78,9 @@ type RingOptions struct {
ReadTimeout time.Duration
WriteTimeout time.Duration
// PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO).
PoolFIFO bool
PoolSize int
MinIdleConns int
MaxConnAge time.Duration
@ -138,6 +141,7 @@ func (opt *RingOptions) clientOptions() *Options {
ReadTimeout: opt.ReadTimeout,
WriteTimeout: opt.WriteTimeout,
PoolFIFO: opt.PoolFIFO,
PoolSize: opt.PoolSize,
MinIdleConns: opt.MinIdleConns,
MaxConnAge: opt.MaxConnAge,