MemoryCacheManagerBuilder
Builder for a thread safe Cache that internally manages a MemoryCache. The cache will periodically persist its data to a SnapshotPersistentCache and will enforce the given CachePolicy. Once the Cache is no longer in use its coroutineScope should be cancelled.
Functions
The CachePolicy to apply to the MemoryCache and its entries.
It is important that the provided coroutineScope live as long as the MemoryCache is in use. Once the coroutineScope is cancelled no further changes to the Cache will be saved to the SnapshotPersistentCache.
The CoroutineDispatcher to use when reading and writing to the SnapshotPersistentCache. Defaults to Dispatchers.IO.
Allows the cache to respond to low memory and critical memory notifications according to the callback functions exposed on MemoryLevelNotifier.memoryLevelCallbacks.
Controls how soon a snapshot of the MemoryCache is persisted after a change to the Cache. The Duration specified by saveFrequency will elapse between each persisted snapshot. This is in addition to the time it takes to persist the snapshot itself.
The Telemeter to use for logging internal events and errors. Defaults to null (no logging).