mirror of
https://github.com/redis/go-redis.git
synced 2025-09-05 20:24:00 +03:00
chore(client): fix UniversalOptions miss ReadBufferSize and WriteBufferSize options (#3485)
Signed-off-by: Xiaolong Chen <fukua95@gmail.com>
This commit is contained in:
23
universal.go
23
universal.go
@@ -61,6 +61,20 @@ type UniversalOptions struct {
|
|||||||
WriteTimeout time.Duration
|
WriteTimeout time.Duration
|
||||||
ContextTimeoutEnabled bool
|
ContextTimeoutEnabled bool
|
||||||
|
|
||||||
|
// ReadBufferSize is the size of the bufio.Reader buffer for each connection.
|
||||||
|
// Larger buffers can improve performance for commands that return large responses.
|
||||||
|
// Smaller buffers can improve memory usage for larger pools.
|
||||||
|
//
|
||||||
|
// default: 256KiB (262144 bytes)
|
||||||
|
ReadBufferSize int
|
||||||
|
|
||||||
|
// WriteBufferSize is the size of the bufio.Writer buffer for each connection.
|
||||||
|
// Larger buffers can improve performance for large pipelines and commands with many arguments.
|
||||||
|
// Smaller buffers can improve memory usage for larger pools.
|
||||||
|
//
|
||||||
|
// default: 256KiB (262144 bytes)
|
||||||
|
WriteBufferSize int
|
||||||
|
|
||||||
// PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO).
|
// PoolFIFO uses FIFO mode for each node connection pool GET/PUT (default LIFO).
|
||||||
PoolFIFO bool
|
PoolFIFO bool
|
||||||
|
|
||||||
@@ -143,6 +157,9 @@ func (o *UniversalOptions) Cluster() *ClusterOptions {
|
|||||||
WriteTimeout: o.WriteTimeout,
|
WriteTimeout: o.WriteTimeout,
|
||||||
ContextTimeoutEnabled: o.ContextTimeoutEnabled,
|
ContextTimeoutEnabled: o.ContextTimeoutEnabled,
|
||||||
|
|
||||||
|
ReadBufferSize: o.ReadBufferSize,
|
||||||
|
WriteBufferSize: o.WriteBufferSize,
|
||||||
|
|
||||||
PoolFIFO: o.PoolFIFO,
|
PoolFIFO: o.PoolFIFO,
|
||||||
|
|
||||||
PoolSize: o.PoolSize,
|
PoolSize: o.PoolSize,
|
||||||
@@ -200,6 +217,9 @@ func (o *UniversalOptions) Failover() *FailoverOptions {
|
|||||||
WriteTimeout: o.WriteTimeout,
|
WriteTimeout: o.WriteTimeout,
|
||||||
ContextTimeoutEnabled: o.ContextTimeoutEnabled,
|
ContextTimeoutEnabled: o.ContextTimeoutEnabled,
|
||||||
|
|
||||||
|
ReadBufferSize: o.ReadBufferSize,
|
||||||
|
WriteBufferSize: o.WriteBufferSize,
|
||||||
|
|
||||||
PoolFIFO: o.PoolFIFO,
|
PoolFIFO: o.PoolFIFO,
|
||||||
PoolSize: o.PoolSize,
|
PoolSize: o.PoolSize,
|
||||||
PoolTimeout: o.PoolTimeout,
|
PoolTimeout: o.PoolTimeout,
|
||||||
@@ -250,6 +270,9 @@ func (o *UniversalOptions) Simple() *Options {
|
|||||||
WriteTimeout: o.WriteTimeout,
|
WriteTimeout: o.WriteTimeout,
|
||||||
ContextTimeoutEnabled: o.ContextTimeoutEnabled,
|
ContextTimeoutEnabled: o.ContextTimeoutEnabled,
|
||||||
|
|
||||||
|
ReadBufferSize: o.ReadBufferSize,
|
||||||
|
WriteBufferSize: o.WriteBufferSize,
|
||||||
|
|
||||||
PoolFIFO: o.PoolFIFO,
|
PoolFIFO: o.PoolFIFO,
|
||||||
PoolSize: o.PoolSize,
|
PoolSize: o.PoolSize,
|
||||||
PoolTimeout: o.PoolTimeout,
|
PoolTimeout: o.PoolTimeout,
|
||||||
|
Reference in New Issue
Block a user