Package io.rtr.alchemy.caching
Class PeriodicStaleCheckingCacheStrategy
java.lang.Object
io.rtr.alchemy.caching.BasicCacheStrategy
io.rtr.alchemy.caching.PeriodicStaleCheckingCacheStrategy
- All Implemented Interfaces:
CacheStrategy
This caching strategy will periodically check whether the data in the cache is stale, and if so,
refresh it. The periodic checking of staleness is driven by cache reads, so, any time the cache
is read, if it's been a while since the last refresh and the data is stale, the cache will be
refreshed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonCacheRead(CachingContext context) Fires before all experiments are read from the cachevoidonCacheRead(String experimentName, CachingContext context) Fires before an experiment is read from the cacheMethods inherited from class io.rtr.alchemy.caching.BasicCacheStrategy
onDelete, onLoad, onSave
-
Constructor Details
-
PeriodicStaleCheckingCacheStrategy
public PeriodicStaleCheckingCacheStrategy(org.joda.time.Duration period)
-
-
Method Details
-
onCacheRead
Description copied from interface:CacheStrategyFires before an experiment is read from the cache- Specified by:
onCacheReadin interfaceCacheStrategy- Overrides:
onCacheReadin classBasicCacheStrategy
-
onCacheRead
Description copied from interface:CacheStrategyFires before all experiments are read from the cache- Specified by:
onCacheReadin interfaceCacheStrategy- Overrides:
onCacheReadin classBasicCacheStrategy
-