Auto Recache Write Key Values Repo
open class AutoRecacheWriteKeyValuesRepo<Id, RegisteredObject>(originalRepo: WriteKeyValuesRepo<Id, RegisteredObject>, scope: CoroutineScope, kvCache: KeyValueRepo<Id, List<RegisteredObject>> = MapKeyValueRepo()) : WriteKeyValuesRepo<Id, RegisteredObject> , FallbackCacheRepo(source)
Constructors
Link copied to clipboard
constructor(originalRepo: WriteKeyValuesRepo<Id, RegisteredObject>, scope: CoroutineScope, kvCache: KeyValueRepo<Id, List<RegisteredObject>> = MapKeyValueRepo())
Functions
Link copied to clipboard
fun <Key, Value> WriteKeyValuesRepo<Key, Value>.caching(kvCache: KeyValueRepo<Key, List<Value>>, scope: CoroutineScope = CoroutineScope(Dispatchers.Default), locker: SmartRWLocker = SmartRWLocker()): FullWriteKeyValuesCacheRepo<Key, Value>
Link copied to clipboard
Link copied to clipboard
Invalidates its internal data. It may lead to autoreload of data. In case when repo makes autoreload, it must do loading of data before clear
Link copied to clipboard
Link copied to clipboard
inline fun <FromKey, FromValue, ToKey, ToValue> WriteKeyValuesRepo<ToKey, ToValue>.withMapper(mapper: MapperRepo<FromKey, FromValue, ToKey, ToValue>): WriteKeyValuesRepo<FromKey, FromValue>
inline fun <FromKey, FromValue, ToKey, ToValue> WriteKeyValuesRepo<ToKey, ToValue>.withMapper(noinline keyFromToTo: suspend FromKey.() -> ToKey = { this as ToKey }, noinline valueFromToTo: suspend FromValue.() -> ToValue = { this as ToValue }, noinline keyToToFrom: suspend ToKey.() -> FromKey = { this as FromKey }, noinline valueToToFrom: suspend ToValue.() -> FromValue = { this as FromValue }): WriteKeyValuesRepo<FromKey, FromValue>