Package-level declarations

Types

Link copied to clipboard

A generic cache for objects of type V.

Link copied to clipboard
interface CacheTransaction<V>

An atomic transaction run on a cache for objects of type V.

Link copied to clipboard
class InMemoryCache<V> : Cache<V>

A basic in-memory cache.

Functions

Link copied to clipboard
suspend fun <V> CacheTransaction<V>.getOrPut(key: String, defaultValue: suspend () -> V): V

Gets the current cached value for the given key or creates and caches a new one.

Link copied to clipboard
suspend fun <V, F> CacheTransaction<V>.getOrTryPut(key: String, defaultValue: suspend () -> Try<V, F>): Try<V, F>

Gets the current cached value for the given key or creates and caches a new one.