Options
All
  • Public
  • Public/Protected
  • All
Menu

Class IntervalGarbageCollector<Key, Value, Entry>

GarbageCollector implementation which evicts expired entries at regular interval (has no internal data structures).
Eviction timer will fire periodically at the interval specified by IntervalGarbageCollectorOptions.checkInterval. When it fires, it will iterate over IntervalGarbageCollectorOptions.iterateCount backend entries, check if any of them is expired and evict if so. After that, it will schedule running for next interval. On next run, it will continue iteration from the entry it will stopped on previous run.

Type parameters

  • Key

    Key type.

  • Value

    Value type.

  • Entry: ExpirableEntry

    Cache entry type.

Hierarchy

  • IntervalGarbageCollector

Implements

Constructors

constructor

Accessors

idle

  • get idle(): boolean

size

  • get size(): number

Methods

clear

  • clear(): void

leave

  • leave(): void
  • Leaves entry without expiration, by un-managing it.

    Returns void

manage

  • manage(): void

setEntryExpiredCallback

update

  • update(): void
  • Notify GC about expiration change of the managed entry.

    Returns void