Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface GarbageCollector<T>

Garbage Collector manages expiration for a set of entries.

Type parameters

  • T: ExpirableEntry

    Type of the entry.

Hierarchy

  • GarbageCollector

Implemented by

Properties

idle

idle: boolean

Whether GC is idle.

size

size: number

Number of managed entries.

Methods

clear

  • clear(): void
  • Clear all managed entries.

    Returns void

leave

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

    Parameters

    • entry: T

      Entry to be un-managed.

    Returns void

manage

  • manage(entry: T): void
  • Manage entry expiration.

    Parameters

    • entry: T

      Entry to be managed.

    Returns void

setEntryExpiredCallback

  • Register callback invoked when entry expires.

    Parameters

    Returns void

update

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

    Parameters

    • oldExpiration: number

      Old expiration of the entry.

    • entry: T

      Managed entry containing new expiration.

    Returns void