dartlcemodel_cache library

Cache tools for LCE model

Classes

AlwaysValid
Entity that is always valid Singleton. Use instance to get
AsyncCacheDelegate<D extends Object, P extends Object>
Delegate that asynchronously performs caching operations D - data type to store P - params type
AsyncCacheFriendDelegate<D extends Object, P extends CacheFriend>
Wraps delegate adding unmodified CacheFriend.cacheKey to the mix with data. Validates that key on get and returns null if it is not equals original. Helps to make sure the data returned is not a result of clashed cache key.
CacheFriend
Generates a cache-friendly key value for parameters
CacheManager
Closes and deletes cache May be used to close or delete all scoped cache at once e.g. for current user
DataWithCacheKey<D extends Object>
Data combined with full cached key to validate we get exactly what we are looking for For example, DiskLruCache has strict requirements and limited length of a cache key and hashing of keys may be required to fit into requirements - thus there is a possibility of key clash.
Entity<T extends Object>
Cache-controlling entity. Implement this interface for cache control
EntityImpl<T extends Object>
Entity implementation
EntityValidator
Entity validator Controls entity lifetime
EntityValidatorDeserializer
Deserializes validator from string
EntityValidatorFactory
Cache-control EntityValidator factory for operations
IsolateCacheDelegate<D extends Object, P extends Object>
AsyncCacheDelegate that runs operations in Isolate D - data type to store P - params type
Lifespan
Uses creation time and TTL to validate
MemoryCacheDelegate<D extends Object, P extends Object>
A simple memory cache for cache-service D Data type P Params type
MemoryDelegateCache<D extends Object, P extends Object>
Memory cache abstraction to handle cache size, LRU, etc (later)
NeverValid
Entity that is never valid Singleton. Use instance to get
Simple
A simple validator which state is defined on creation May be used to fix the isValid state of dynamic validator such as Lifespan
SyncCacheDelegate<D extends Object, P extends Object>
Delegate that synchronously performs caching operations D - data type to store P - params type
SyncCacheFriendDelegate<D extends Object, P extends CacheFriend>
Wraps delegate adding unmodified CacheFriend.cacheKey to the mix with data. Validates that key on get and returns null if it is not equals original. Helps to make sure the data returned is not a result of clashed cache key.

Mixins

EntityValidatorMixin
Delegates EntityValidator to validator provided by host class