newTieredCache<T> method

  1. @override
TieredCache<T> newTieredCache<T>(
  1. Cache<T> primary,
  2. Cache<T> secondary, {
  3. String? name,
  4. Clock? clock,
  5. bool? statsEnabled,
  6. CacheStats? stats,
})
override

Builds a new Tiered Cache

  • primary: The primary cache
  • secondary: The secondary cache
  • name: The name of the cache
  • clock: The source of time to be used on this, defaults to the system clock if not provided
  • statsEnabled: If statistics should be collected, defaults to false
  • stats: 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;
}