Package-level declarations

Types

Link copied to clipboard
interface ContainerKache<K : Any, C : Any>

An interface that represents a cache that holds entries within containers such as files.

Link copied to clipboard
typealias EntryRemovedListener<K, V> = (evicted: Boolean, key: K, oldValue: V, newValue: V?) -> Unit

A listener that is triggered when a cache entry is removed.

Link copied to clipboard
class InMemoryKache<K : Any, V : Any> : ObjectKache<K, V>

An in-memory coroutine-safe versatile cache that stores objects by keys.

Link copied to clipboard
data class KacheKeys<K>(val keys: Set<K>, val underCreationKeys: Set<K>)

A snapshot of the keys in the cache.

Link copied to clipboard

Specifies the strategy to use when the cache has reached its capacity. The most common strategy is LRU (Least Recently Used).

Link copied to clipboard
interface ObjectKache<K : Any, V : Any>

An interface that represents a cache that holds entries in memory without serialization.

Link copied to clipboard
typealias SizeCalculator<K, V> = (key: K, value: V) -> Long

A function for calculating the size of a cache entry represented by the provided key * and value.

Functions

Link copied to clipboard
fun <K : Any, V : Any> InMemoryKache(maxSize: Long, configuration: InMemoryKache.Configuration<K, V>.() -> Unit = {}): InMemoryKache<K, V>

Creates a new instance of InMemoryKache with the given maxSize and configuration.