ShieldedCache v1.3.1 ShieldedCache.Functions View Source
ShieldedCache.Functions
The cache functions for the ShieldedCache
module. These are injected into every
ShieldedCache
instance, and give the module the functionality for get_or_fetch
.
Link to this section Summary
Link to this section Functions
Link to this function
get_or_fetch(cache_name, caching_module, caching_module_name, ttl, cache_request)
View Source
get_or_fetch/4
Gets the requested value.
If the value is valid, returns the {:ok, value}
.
If the value is expired, returns the expired_value
and
adds the cache_request that requires a refresh to the TaskManager
.
If there is an error, returns {:error, reason}
.