Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BucketGarbageCollector<T>

GarbageCollector implementation which uses a map of buckets to keep entries that needs to be evicted.
Each timestamp has an according bucket with entries that need to be evicted at that time.
A timer is set to tick on each second and evicts all entries from the bucket corresponding to timestamp when timer fired.

Type parameters

  • T: ExpirableEntry

    Type of the cache entry.

Hierarchy

  • BucketGarbageCollector

Implements

Constructors

constructor

Accessors

idle

  • get idle(): boolean

size

  • get size(): number

Methods

clear

  • clear(): void

leave

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

    Parameters

    • entry: T

    Returns void

manage

  • manage(entry: T): void

setEntryExpiredCallback

update

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

    Parameters

    • oldExpiration: number
    • entry: T

    Returns void