ConnectionPoolConfiguration
public struct ConnectionPoolConfiguration
The configuration of a ConnectionPool
.
-
Creates a
ConnectionPoolConfiguration
.Declaration
Swift
public init()
-
The maximum number of connections in the
ConnectionPool
. Defaults to10
.Declaration
Swift
public var maximumConnections: Int
-
The maximum size of the backlog of requests for connections, or
nil
for no limit. Defaults tonil
.Declaration
Swift
public var maximumPendingRequests: Int?
-
The maximum time, in seconds, that requests for connections will wait before timing out, or
nil
for no timeout. Defaults tonil
.Declaration
Swift
public var pendingRequestTimeout: Int?
-
The maximum time, in seconds, that connections allocated to requests can be used before timing out, or
nil
for no timeout. Defaults tonil
.Declaration
Swift
public var allocatedConnectionTimeout: Int?
-
The
DispatchQueue
on which completion handlers forConnectionPool.acquireConnection(completionHandler:)
andConnectionPool.withConnection(completionHandler:)
are executed.This dispatch queue is also used for asynchronous tasks internally performed by the
ConnectionPool
, such as managing timeouts and periodic logging of performance metrics.Defaults to
DispatchQueue.global()
.Declaration
Swift
public var dispatchQueue: DispatchQueue
-
The interval, in seconds, between periodic logging of
ConnectionPool
performance metrics, ornil
to not log performance metrics.For example, a value of
3600
causes metrics to be logged once an hour (at the start of the hour). A value of21600
causes metrics to be logged every 6 hours (at midnight, 06:00, noon, and 18:00 UTC).Metrics are logged with
LogLevel.info
.Defaults to
3600
.Declaration
Swift
public var metricsLoggingInterval: Int?
-
Whether the
ConnectionPool
performance metrics are reset each time they are logged. Defaults totrue
.Declaration
Swift
public var metricsResetWhenLogged: Bool