WriteThroughStore<K, V> class
A cache that persists every write to the backing store immediately.
Constructors
-
WriteThroughStore({required CacheLoader<
K, V> load, required CacheStorer<K, V> store}) -
Creates a cache backed by
load(read-through on a miss) andstore(called on every put before the in-memory entry is updated). Audited: 2026-06-12 11:26 EDT
Properties
Methods
-
get(
K key) → Future< V?> - Returns the cached value, loading and caching it on a miss. A backing store that returns null is treated as "absent" and is not cached. Audited: 2026-06-12 11:26 EDT
-
invalidate(
K key) → void -
Drops the in-memory entry for
keywithout touching the backing store. Audited: 2026-06-12 11:26 EDT -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
K key, V value) → Future< void> -
Persists
valueto the store, then updates the in-memory entry. The store write is awaited first so a failed write leaves the cache unchanged. Audited: 2026-06-12 11:26 EDT -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited