Search code examples
scalacachinglru

synchronous in-memory LRU cache map


I am looking for a simple LRU cache in Scala that works in-memory. It's used only on the Swing event dispatch thread, and so I don't want futures, like in the Spray caching code.

Basically I need a Map[Int, java.awt.Paint] with a bounded size.


Solution

  • I'm not aware of something implemented in Scala, but you can use Java libraries such as concurrentlinkedhashmap or Guava.