LuckyCache::MemoryStore
Inherits LuckyCache::BaseStore < Struct < Value < Object
Constructors
new
SourceInstance methods
fetch(key : CacheKey, *, as : Array(T).class, expires_in : Time::Span = LuckyCache.settings.default_duration, &) forall T
If the CacheItem exists, it will map the Array(Cacheable)
in to Array(T). If no item is found, write the block value
and return the block value
fetch(key : CacheKey, *, as : T.class, expires_in : Time::Span = LuckyCache.settings.default_duration, &) forall T
If the CacheItem exists, it will cast the Cacheable
in to T. If no item is found, write the block value
and return the block value
read(key : CacheKey) : CacheItem | Nil
Returns the CacheItem or nil if the key is not found.
If the key is found, but the item is expired, remove it and return nil.
Adds the block value to the cache. Returns the block value