AutoRecacheReadKeyValuesRepo

open class AutoRecacheReadKeyValuesRepo<Id, RegisteredObject>(originalRepo: ReadKeyValuesRepo<Id, RegisteredObject>, scope: CoroutineScope, kvCache: FullKVCache<Id, List<RegisteredObject>> = FullKVCache(), recacheDelay: Long = 60.seconds.inWholeMilliseconds, actionWrapper: ActionWrapper = ActionWrapper.Direct) : ReadKeyValuesRepo<Id, RegisteredObject> , FallbackCacheRepo

Inheritors

Constructors

Link copied to clipboard
constructor(originalRepo: ReadKeyValuesRepo<Id, RegisteredObject>, scope: CoroutineScope, originalCallTimeoutMillis: Long, kvCache: FullKVCache<Id, List<RegisteredObject>> = FullKVCache(), recacheDelay: Long = 60.seconds.inWholeMilliseconds)
constructor(originalRepo: ReadKeyValuesRepo<Id, RegisteredObject>, scope: CoroutineScope, kvCache: FullKVCache<Id, List<RegisteredObject>> = FullKVCache(), recacheDelay: Long = 60.seconds.inWholeMilliseconds, actionWrapper: ActionWrapper = ActionWrapper.Direct)

Functions

Link copied to clipboard
open suspend override fun contains(k: Id): Boolean
open suspend override fun contains(k: Id, v: RegisteredObject): Boolean
Link copied to clipboard
open suspend override fun count(): Long
open suspend override fun count(k: Id): Long
Link copied to clipboard
open suspend override fun get(k: Id, pagination: Pagination, reversed: Boolean): PaginationResult<RegisteredObject>
Link copied to clipboard
open suspend fun getAll(reverseLists: Boolean = false): Map<Id, List<RegisteredObject>>

WARNING!!! THIS METHOD PROBABLY IS NOT EFFICIENT, USE WITH CAUTION

open suspend fun getAll(k: Id, reversed: Boolean = false): List<RegisteredObject>
Link copied to clipboard
open suspend override fun invalidate()
Link copied to clipboard
open suspend override fun keys(pagination: Pagination, reversed: Boolean): PaginationResult<Id>
open suspend override fun keys(v: RegisteredObject, pagination: Pagination, reversed: Boolean): PaginationResult<Id>
Link copied to clipboard
Link copied to clipboard
inline fun <FromKey, FromValue, ToKey, ToValue> ReadKeyValuesRepo<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 }): ReadKeyValuesRepo<FromKey, FromValue>

Properties

Link copied to clipboard
val autoUpdateJob: Job