Cache

interface Cache<in K : Any, V : Any>

A cache for CookieStorage

Functions

Link copied to clipboard
abstract suspend fun getOrCompute(key: K): V

Returns value for key or computes ans saves it if it's not found in the cache.

Link copied to clipboard
abstract fun invalidate(key: K): V?

Invalidates key in the cache.

abstract fun invalidate(key: K, value: V): Boolean

Invalidates key in this cache if its value equals to value.

Link copied to clipboard
abstract fun invalidateAll()

Invalidates all keys in the cache.

Link copied to clipboard
abstract fun peek(key: K): V?

Returns value for key or null if it's not found in the cache.