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

com.malliina.http.OkHttpBackend.scala Maven / Gradle / Ivy

package com.malliina.http

import java.io.Closeable

import okhttp3.OkHttpClient

trait OkHttpBackend extends Closeable {
  def client: OkHttpClient

  override def close(): Unit = {
    client.dispatcher().executorService().shutdown()
    client.connectionPool().evictAll()
    Option(client.cache()).foreach(_.close())
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy