com.twitter.storehaus.cache
Returns an instance of Function5 memoized using the supplied mutable cache.
scala> import com.twitter.storehaus.cache._ scala> type Input = (Int, Int, Int, Int, Int) scala> val cache = MapCache.empty[Input, String].toMutable() cache: <munged> scala> val memoFn = Memoize(cache) { (x1, x2, x3, x4, x5) => | println("calculating!") | (x1, x2, x3, x4, x5).toString | } memoFn: <munged> scala> memoFn(1, 2, 3, 4, 5) calculating! res4: String = (1, 2, 3, 4, 5) scala> memoFn(1, 2, 3, 4, 5) res5: String = (1, 2, 3, 4, 5)
Returns an instance of Function5 memoized using the supplied mutable cache.