WriteBackStore<K, V> class

A cache that buffers writes in memory until flush persists them.

Constructors

WriteBackStore({required CacheLoader<K, V> load, required CacheStorer<K, V> store})
Creates a cache backed by load (read-through on a miss) and store (called once per dirty key during flush). Audited: 2026-06-12 11:26 EDT

Properties

dirtyKeys Set<K>
Keys with buffered writes not yet persisted (an unmodifiable snapshot). Audited: 2026-06-12 11:26 EDT
no setter
hashCode int
The hash code for this object.
no setterinherited
length int
Number of entries currently held in memory. Audited: 2026-06-12 11:26 EDT
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

flush() Future<void>
Persists every dirty entry to the backing store and clears the dirty set. A store failure aborts the flush; already-written keys stay clean, the failing key and any after it remain dirty for the next attempt. Audited: 2026-06-12 11:26 EDT
get(K key) Future<V?>
Returns the cached value, loading and caching it on a miss. 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) → void
Updates the in-memory entry and marks it dirty; the store is untouched until flush. Repeated puts to one key collapse into a single later write. 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