AlphaXMemoryCacheStore class final
Bounded in-memory cache storage.
Entries are evicted in insertion order when either bound is exceeded. Entries larger than maxBytes are ignored rather than allowing one response to defeat the configured memory bound.
- Implemented types
Constructors
- AlphaXMemoryCacheStore({int maxEntries = 100, int maxBytes = 10 * 1024 * 1024})
- Creates an in-memory cache.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- length → int
-
Number of currently stored variants.
no setter
- maxBytes → int
-
Maximum total body bytes retained.
final
- maxEntries → int
-
Maximum number of variants retained.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- totalBytes → int
-
Total body bytes currently retained.
no setter
Methods
-
clear(
) → Future< void> -
Clears all entries.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
AlphaXCacheKey key) → Future< AlphaXCacheEntry?> -
Reads the matching response variant for
key.override -
remove(
AlphaXCacheKey key) → Future< void> -
Removes all variants for
key's method and URI.override -
toString(
) → String -
A string representation of this object.
inherited
-
write(
AlphaXCacheEntry entry) → Future< void> -
Stores
entry, including its variant key and response metadata.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited