Skip to content

Commit

Permalink
doc: add comments to ConnWriteTimeout as a request timeout (#469)
Browse files Browse the repository at this point in the history
* doc: add comments to connwritetimeout

* doc: fix wrong comments
  • Loading branch information
proost authored Feb 16, 2024
1 parent 5a8fa52 commit 3d21559
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rueidis.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ type ClientOption struct {
// The default for cluster clients is 0, which means 1 connection (2^0).
PipelineMultiplex int

// ConnWriteTimeout is applied net.Conn.SetWriteDeadline and periodic PING to redis
// ConnWriteTimeout is read/write timeout for each connection. If specified,
// it is used to control the maximum duration waits for responses to pipeline commands.
// Also, ConnWriteTimeout is applied net.Conn.SetDeadline and periodic PING to redis
// Since the Dialer.KeepAlive will not be triggered if there is data in the outgoing buffer,
// ConnWriteTimeout should be set in order to detect local congestion or unresponsive redis server.
// This default is ClientOption.Dialer.KeepAlive * (9+1), where 9 is the default of tcp_keepalive_probes on Linux.
Expand Down

0 comments on commit 3d21559

Please sign in to comment.