Skip to content

Instantly share code, notes, and snippets.

@stasimus
Created September 17, 2018 20:56
Show Gist options
  • Save stasimus/08fd1141910a1e395e06884ac1c4e49d to your computer and use it in GitHub Desktop.
Save stasimus/08fd1141910a1e395e06884ac1c4e49d to your computer and use it in GitHub Desktop.
import com.github.benmanes.caffeine.cache.Caffeine
import scala.concurrent.duration.Duration
import scalacache._
import scalacache.caffeine.CaffeineCache
object CacheApp extends App {
val intCache: Cache[Int] = new CaffeineCache[Int](Caffeine.newBuilder().build[String, Entry[Int]]()) with Predicate[Int] {
override def shouldCache: Int => Boolean = _ > 0 }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment