repletes - v1.1.0
    Preparing search index...

    Class MemoryStore<T>

    In-process store. Evicts the least recently used entry once maxEntries is exceeded, and drops entries past their retention on read.

    Eviction here is about space, not about correctness: the read decision is made from the entry's own windows, never from whether this store still has it.

    Type Parameters

    • T = unknown

    Implements

    Index
    • get size(): number

      How many entries are held right now. Useful in tests, not a policy input.

      Returns number

    • Optional, and may be O(n) on a store that has to scan a key prefix.

      Returns Promise<void>

    • Expiry is measured against this store's own clock, not the writer's.

      Parameters

      • key: string
      • entry: Entry<T>
      • retainFor: number

      Returns Promise<void>