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 to 10.

    Declaration

    Swift

    public var maximumConnections: Int
  • The maximum size of the backlog of requests for connections, or nil for no limit. Defaults to nil.

    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 to nil.

    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 to nil.

    Declaration

    Swift

    public var allocatedConnectionTimeout: Int?
  • The DispatchQueue on which completion handlers for ConnectionPool.acquireConnection(completionHandler:) and ConnectionPool.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, or nil 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 of 21600 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 to true.

    Declaration

    Swift

    public var metricsResetWhenLogged: Bool