All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spice.http.client.ConnectionPool.scala Maven / Gradle / Ivy

There is a newer version: 0.6.1
Show newest version
package spice.http.client

import scala.concurrent.duration._

import reactify._

trait ConnectionPool {
  def maxIdleConnections: Int
  def keepAlive: FiniteDuration

  def idle: Int
  def active: Int
  def total: Int = idle + active
}

object ConnectionPool {
  var maxIdleConnections: Int = 100
  var keepAlive: FiniteDuration = 5.minutes

  def apply(client: HttpClient,
            maxIdleConnections: Int = maxIdleConnections,
            keepAlive: FiniteDuration = keepAlive): ConnectionPool = {
    client.implementation.connectionPool(maxIdleConnections, keepAlive)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy