KacheController

abstract class KacheController(val cacheEnabled: () -> Boolean = { true }, cache: CacheClient, asyncWriteScope: CoroutineScope? = null, onAsyncWriteError: (Throwable) -> Unit = {})

Abstract base class implementing read-through/write-through caching logic.

Subclasses provide the typed public API for a specific database backend (e.g. MongoKacheController, ExposedKacheController).

Parameters

cacheEnabled

Called before every operation; when false the cache is bypassed.

cache

The CacheClient backend (Redis, in-memory, SQLite, etc.).

asyncWriteScope

If set, enables write-behind via setAsyncInternal/setAllAsyncInternal.

onAsyncWriteError

Optional handler for errors caught during async write execution.

Constructors

Link copied to clipboard
constructor(cacheEnabled: () -> Boolean = { true }, cache: CacheClient, asyncWriteScope: CoroutineScope? = null, onAsyncWriteError: (Throwable) -> Unit = {})

Properties

Link copied to clipboard