Add ConnPoolStrategy field to client (#1317)

This commit is contained in:
Thearas
2022-06-07 15:21:26 +08:00
committed by GitHub
parent 35aca7b6df
commit 8a320890c0
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -3,5 +3,6 @@ tags
*.fasthttp.gz
*.fasthttp.br
.idea
.vscode
.DS_Store
vendor/
+4
View File
@@ -297,6 +297,9 @@ type Client struct {
// By default will use isIdempotent function
RetryIf RetryIfFunc
// Connection pool strategy. Can be either LIFO or FIFO (default).
ConnPoolStrategy ConnPoolStrategyType
// ConfigureClient configures the fasthttp.HostClient.
ConfigureClient func(hc *HostClient) error
@@ -510,6 +513,7 @@ func (c *Client) Do(req *Request, resp *Response) error {
DisablePathNormalizing: c.DisablePathNormalizing,
MaxConnWaitTimeout: c.MaxConnWaitTimeout,
RetryIf: c.RetryIf,
ConnPoolStrategy: c.ConnPoolStrategy,
clientReaderPool: &c.readerPool,
clientWriterPool: &c.writerPool,
}