@grandlinex/core
    Preparing search index...

    Class CoreTimeCache<T>

    A cache that stores values with a time‑to‑live (TTL) and automatically removes expired entries after a configurable interval.

    The cache stores data objects wrapped in a CachedData<T> structure that tracks the insertion time (last) and the remaining TTL. When an entry expires, a background loop removes it and optionally logs the event.

    Type Parameters

    • T

      The type of the cached data.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    channel: string
    logger: CoreLogger | null

    Methods

    • Extend the ttl of a cached data

      Parameters

      • key: string

        cache key

      • ttl: number = 120000

        add time in ms

      Returns boolean

    • Parameters

      • key: string

        cache key

      • data: T

        data to cache

      • ttl: number = 120000

        time in ms

      Returns void