StateFlowCache

open class StateFlowCache<K, V>(name: String, cacheScope: CoroutineScope, val infiniteCache: Boolean = false, val cacheDuration: Duration = 1.minutes)

Constructors

Link copied to clipboard
fun StateFlowCache(name: String, cacheScope: CoroutineScope, infiniteCache: Boolean = false, cacheDuration: Duration = 1.minutes)

Functions

Link copied to clipboard
fun init(initialValues: Map<K, V>)
Link copied to clipboard
fun readWithCache(key: K, isContainedInCache: suspend (cacheValue: V?) -> Boolean, retrieveAndUpdateCache: suspend (cacheValue: V?) -> V?): Flow<V?>
Link copied to clipboard
fun reset()
Link copied to clipboard
suspend fun writeWithCache(key: K, updater: suspend (oldValue: V?) -> V?, isContainedInCache: suspend (cacheValue: V?) -> Boolean, retrieveAndUpdateCache: suspend (cacheValue: V?) -> V?, persist: suspend (newValue: V?) -> Unit)

Properties

Link copied to clipboard
val cache: SharedFlow<Map<K, StateFlow<V?>>>
Link copied to clipboard
Link copied to clipboard
val infiniteCache: Boolean = false

Inheritors

Link copied to clipboard