CacheChange

sealed interface CacheChange

A mutation observed on a Cache, emitted by Cache.changes.

Describes a mutation without polling. Notifications can be dropped under load, so consumers maintaining a current value must re-read their observed keys on every notification, including notifications naming another key.

Inheritors

Types

Link copied to clipboard
data object Cleared : CacheChange

Every entry was removed.

Link copied to clipboard
data class Removed(val key: CacheKey) : CacheChange

The value stored for key was removed (explicitly or by eviction/expiry).

Link copied to clipboard
data class Updated(val key: CacheKey) : CacheChange

The value stored for key was set or replaced.