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

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

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

import java.util.concurrent.TimeUnit
import scala.concurrent.duration.FiniteDuration

case class OkHttpConnectionPool(maxIdleConnections: Int, keepAlive: FiniteDuration) extends ConnectionPool {
  private[client] lazy val pool = new okhttp3.ConnectionPool(maxIdleConnections, keepAlive.toMillis, TimeUnit.MILLISECONDS)

  override def idle: Int = pool.idleConnectionCount()

  override def active: Int = pool.connectionCount() - pool.idleConnectionCount()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy