Cache

A generic cache for objects of type V.

It implements MemoryObserver to flush unused in-memory objects when necessary.

Inheritors

Functions

Link copied to clipboard
abstract fun close()

Closes this object and releases any resources associated with it. If the object is already closed then invoking this method has no effect.

Link copied to clipboard
abstract fun onTrimMemory(level: MemoryObserver.Level)

Called by the system when memory needs to be freed.

Link copied to clipboard
abstract suspend fun <T> transaction(block: suspend CacheTransaction<V>.() -> T): T

Performs an atomic block transaction on this cache.