Created
January 1, 2021 08:46
-
-
Save Happytreat/2693d6d3f1f764f974e54ece5c49f05f to your computer and use it in GitHub Desktop.
Connection Pool Options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ConnectionOptions struct { | |
// The initial num of active connections when pool is initialised | |
// Pros: Warmup the connection pool with some connections on startup. | |
InitialActiveConnections int | |
// The maximum number of connections that can be active at any given | |
// time | |
MaxActiveConnections int | |
// The maximum number of idle connections per host that are kept alive by | |
// the connection pool. | |
MaxIdleConnections uint | |
// The maximum amount of time an idle connection can stay alive. If not | |
// specified, connection stays active until pool closes or discarded. | |
MaxIdleTime *time.Duration | |
// This specifies the timeout for any Read() operation. | |
// Note that setting this to 0 (i.e. not setting it) will make | |
// read operations block indefinitely. | |
ReadTimeout time.Duration | |
// This specifies the timeout for any Write() operation. | |
// Note that setting this to 0 (i.e. not setting it) will make | |
// write operations block indefinitely. | |
WriteTimeout time.Duration | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment