How to cache results in scala?

前端 未结 5 594
孤街浪徒
孤街浪徒 2020-12-31 01:51

This page has a description of Map\'s getOrElseUpdate usage method:

object WithCache{
  val cacheFun1 = collection.mutable.Map[Int, Int]()
  def         


        
5条回答
  •  醉酒成梦
    2020-12-31 02:23

    Since it hasn't been mentioned before let me put on the table the light Spray-Caching that can be used independently from Spray and provides expected size, time-to-live, time-to-idle eviction strategies.

提交回复
热议问题