Add feature to enable HttpSessionRef idle timeout/period tuning. (#44)
This commit is contained in:
parent
dc9829e24a
commit
ba20cebf0f
|
@ -98,11 +98,14 @@ proc new*(t: typedesc[RestClientRef],
|
|||
maxRedirections: int = HttpMaxRedirections,
|
||||
connectTimeout = HttpConnectTimeout,
|
||||
headersTimeout = HttpHeadersTimeout,
|
||||
idleTimeout = HttpConnectionIdleTimeout,
|
||||
idlePeriod = HttpConnectionCheckPeriod,
|
||||
bufferSize: int = 4096,
|
||||
userAgent = PrestoIdent
|
||||
): RestResult[RestClientRef] =
|
||||
let session = HttpSessionRef.new(httpFlags, maxRedirections, connectTimeout,
|
||||
headersTimeout, bufferSize, maxConnections)
|
||||
headersTimeout, bufferSize, maxConnections,
|
||||
idleTimeout, idlePeriod)
|
||||
var uri = parseUri(url)
|
||||
uri.path = ""
|
||||
uri.query = ""
|
||||
|
@ -126,11 +129,14 @@ proc new*(t: typedesc[RestClientRef],
|
|||
maxRedirections: int = HttpMaxRedirections,
|
||||
connectTimeout = HttpConnectTimeout,
|
||||
headersTimeout = HttpHeadersTimeout,
|
||||
idleTimeout = HttpConnectionIdleTimeout,
|
||||
idlePeriod = HttpConnectionCheckPeriod,
|
||||
bufferSize: int = 4096,
|
||||
userAgent = PrestoIdent
|
||||
): RestClientRef =
|
||||
let session = HttpSessionRef.new(httpFlags, maxRedirections, connectTimeout,
|
||||
headersTimeout, bufferSize, maxConnections)
|
||||
headersTimeout, bufferSize, maxConnections,
|
||||
idleTimeout, idlePeriod)
|
||||
let address = ta.getAddress(scheme, "")
|
||||
RestClientRef(session: session, address: address, agent: userAgent,
|
||||
flags: flags)
|
||||
|
|
Loading…
Reference in New Issue