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