CacheManager<T>.cacheOrSync constructor
CacheManager<T>.cacheOrSync ({
- required SerializerFunc serializerFunc,
- required String key,
- required AsyncFunc<
T> asyncBloc, - int? ttlValue,
Implementation
CacheManager.cacheOrSync(
{required SerializerFunc serializerFunc,
required String key,
required AsyncFunc<T> asyncBloc,
int? ttlValue}) {
_strategyBuilder = StrategyBuilder<T>(key, sotrageImplimentation)
.withSerializer((serializerFunc))
.withAsync(asyncBloc)
.withStrategy(CacheOrAsyncStrategy());
if (ttlValue != null) {
_strategyBuilder.withTtl(ttlValue);
}
}