MemoryCacheStorage<K, V> class
A simple implementation of CacheStorage. Used by default. It just keeps the data in memory.
- Implemented types
-
- CacheStorage<
K, V>
- CacheStorage<
Constructors
- MemoryCacheStorage(String _boxKey)
- Create instance. Takes a unique key for storing data in separate boxes for every repository.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → Future< void> -
Clear all store.
override
-
delete(
K cacheKey) → Future< void> -
Delete cache by
cacheKey
.override -
ensureInitialized(
) → Future< void> -
Must return a future that completes after the storage is ready to be used.
override
-
get(
K cacheKey) → Future< CacheEntry< V> ?> -
Get
CacheEntry
by key.override -
getAll(
) → Future< List< V> > -
Get all stored cache entries.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
K cacheKey, V data, {int? storeTime}) → Future< void> -
Put
data
bycacheKey
withstoreTime
timestamp.override -
toString(
) → String -
A string representation of this object.
override
-
watch(
) → Stream< List< V> > -
Returns a stream to listen all changes in the storage.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
clearAll(
) → Future< void> - Clears all data stored by all repositories in MemoryCacheStorage.