MCPcopy
hub / github.com/redis/node-redis / constructor

Method constructor

packages/client/lib/client/cache.ts:514–525  ·  view source on GitHub ↗
(config?: ClientSideCacheConfig)

Source from the content-addressed store, hash-verified

512 }
513
514 constructor(config?: ClientSideCacheConfig) {
515 super();
516
517 this.#cacheKeyToEntryMap = new Map<string, ClientSideCacheEntry>();
518 this.#keyToCacheKeySetMap = new Map<string, Set<string>>();
519 this.ttl = config?.ttl ?? 0;
520 this.maxEntries = config?.maxEntries ?? 0;
521 this.lru = config?.evictPolicy !== "FIFO";
522
523 const recordStats = config?.recordStats !== false;
524 this.#statsCounter = recordStats ? DefaultStatsCounter.create() : disabledStatsCounter();
525 }
526
527 /* logic of how caching works:
528

Callers

nothing calls this directly

Calls 2

disabledStatsCounterFunction · 0.85
createMethod · 0.45

Tested by

no test coverage detected