ExpiringKeyedCache
A multi-value cache which supports retrieval and invalidation via a key paired with each value. The get and invalidate methods are suspend
functions to allow for cross-context synchronization and potentially-expensive value lookup.
Values in the cache may expire and are retrieved as ExpiringValue. When a value is absent/expired in the cache, invoking get will cause a lookup to occur via the function's valueLookup
parameter.
Parameters
The type of the keys of this cache
The type of the values of this cache
Properties
Functions
Gets the value associated with this key from the cache. If the cache does not contain the given key, implementations are expected to invoke valueLookup, although they may perform other actions such as throw exceptions, fall back to other caches, etc.
Invalidates the value (if any) for the given key, removing it from the cache regardless. This method has no effect if the given key is not present in the cache.