KacheClient class final

Coordinates typed cache resources, persistence, and shared key state.

Constructors

KacheClient({String? id, KachePersistenceBackend? persistence, KachePersistenceOwnership persistenceOwnership = KachePersistenceOwnership.borrowed, KacheNetwork? network, KacheNetworkOwnership networkOwnership = KacheNetworkOwnership.borrowed, KacheClock clock = systemKacheClock, KacheScheduler scheduler = systemKacheScheduler, KacheObserver? observer})
Creates a cache client with optional persistence.

Properties

events → Stream<KacheEvent>
Broadcast trusted in-process lifecycle events without replay.
no setter
hashCode → int
The hash code for this object.
no setterinherited
id → String
Stable identity included in every event emitted by this client.
final
isClosed → bool
Whether close has started.
no setter
network → KacheNetwork?
Optional network source used for reconnect revalidation.
final
networkOwnership → KacheNetworkOwnership
Whether this client closes network.
final
networkState → KacheNetworkState?
Latest state emitted by network, or null before its first state.
no setter
persistence → KachePersistenceBackend?
The optional persistence backend used by persisted queries.
final
persistenceOwnership → KachePersistenceOwnership
Whether this client closes persistence.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancel(KacheKey key) → bool
Cancels the shared in-flight fetch for key.
cancelAll() → int
Cancels every currently cancellable fetch and returns the affected count.
clear({bool refetch = false}) → Future<KacheClearResult>
Clears every active memory and persisted cache entry.
clearNamespace(KacheNamespace namespace, {bool refetch = false}) → Future<KacheClearResult>
Clears active memory and persisted entries in namespace.
close({bool drainWrites = true}) → Future<void>
Closes resources and, when owned, the configured persistence backend.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pausePolling() → void
Pauses interval-based refresh without affecting manual commands.
pauseReconnect() → void
Pauses network-recovery revalidation without stopping state observation.
peek<T>(KacheKey key) → KacheSnapshot<T>?
Returns the active in-memory snapshot for key without I/O or loading.
prefetch<T>(KacheQuery<T> query) → Future<KacheSnapshot<T>>
Loads query without retaining a public resource handle.
refreshActive() → Future<void>
Forces refresh on every active handle.
resumePolling() → void
Resumes interval-based refresh for active resources.
resumeReconnect() → void
Resumes network-recovery revalidation and consumes one pending recovery.
revalidateOnReconnect() → Future<void>
Revalidates active handles according to each reconnect policy.
revalidateOnResume() → Future<void>
Revalidates active handles according to each resume policy.
toString() → String
A string representation of this object.
inherited
watch<T>(KacheQuery<T> query) → KacheResource<T>
Creates an independent resource handle for query.

Operators

operator ==(Object other) → bool
The equality operator.
inherited