newTieredCache<T> method
TieredCache<T>
newTieredCache<T>(
- Cache<
T> primary, - Cache<
T> secondary, { - String? name,
- Clock? clock,
- bool? statsEnabled,
- CacheStats? stats,
override
Builds a new Tiered Cache
primary
: The primary cachesecondary
: The secondary cachename
: The name of the cacheclock
: The source of time to be used on this, defaults to the system clock if not providedstatsEnabled
: If statistics should be collected, defaults to falsestats
: The statistics instance
Returns a new Cache
Implementation
@override
TieredCache<T> newTieredCache<T>(Cache<T> primary, Cache<T> secondary,
{String? name, Clock? clock, bool? statsEnabled, CacheStats? stats}) {
final cache = TieredCache<T>(primary, secondary,
manager: this,
name: name,
clock: clock,
statsEnabled: statsEnabled,
stats: stats);
_caches[cache.name] = cache;
return cache;
}