Memoiser

scroll.internal.util.Memoiser
object Memoiser

Support for building caches using Guava caches.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Memoiser.type

Members list

Value members

Concrete methods

def buildCache[K <: AnyRef, V <: AnyRef](supplier: K => V): LoadingCache[K, V]

Builds a cache, which either returns an already-loaded value for a given key or atomically computes or retrieves it using the supplied supplier . If another thread is currently loading the value for this key, simply waits for that thread to finish and returns its loaded value. Note that multiple threads can concurrently load values for distinct keys.

Builds a cache, which either returns an already-loaded value for a given key or atomically computes or retrieves it using the supplied supplier . If another thread is currently loading the value for this key, simply waits for that thread to finish and returns its loaded value. Note that multiple threads can concurrently load values for distinct keys.

Value parameters

supplier

the function to be used for loading values; must never return null

Attributes

Returns

a cache loader that loads values by passing each key to supplier