TieredCache<T> constructor

TieredCache<T>(
  1. Cache<T> _primary,
  2. Cache<T> _secondary, {
  3. CacheManager? manager,
  4. String? name,
  5. Clock? clock,
  6. bool? statsEnabled,
  7. CacheStats? stats,
})

Builds a TieredCache with a primary and a secondary cache

  • _primary: The primary Cache
  • _secondary: The secondary Cache
  • manager: An optional CacheManager
  • 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, defaults to DefaultCacheStats

Returns a TieredCache

Implementation

TieredCache(this._primary, this._secondary,
    {this.manager,
    String? name,
    Clock? clock,
    bool? statsEnabled,
    CacheStats? stats})
    : name = name ?? Uuid().v1(),
      clock = clock ?? Clock(),
      statsEnabled = statsEnabled ?? false,
      stats = stats ?? DefaultCacheStats();