@grandlinex/kernel
    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
    • Type Parameters

      • T

        The type of the cached data.

      Parameters

      • name: string
      • Optionallog: IHaveLogger | null
      • OptionalloopTime: number

      Returns CoreTimeCache<T>

    channel: string
    logger: CoreLogger | null
    • Parameters

      • ...ags: unknown[]

      Returns void

    • Delete cached data

      Parameters

      • key: string

      Returns void

    • Parameters

      • ...ags: unknown[]

      Returns void

    • Extend the ttl of a cached data

      Parameters

      • key: string

        cache key

      • Optionalttl: number

        add time in ms

      Returns boolean

    • Flash the cache

      Returns void

    • Get cached data

      Parameters

      • key: string

      Returns T | null

    • Returns string

    • Get raw cached data object

      Parameters

      • key: string

      Returns CachedData<T> | null

    • Has cached data

      Parameters

      • key: string

      Returns boolean

    • Parameters

      • ...ags: unknown[]

      Returns void

    • Parameters

      • message: string

      Returns Error

    • Parameters

      • ...ags: unknown[]

      Returns void

    • Parameters

      • key: string

        cache key

      • data: T

        data to cache

      • Optionalttl: number

        time in ms

      Returns void

    • Get raw cached data object

      Parameters

      Returns void

    • Stop the background cache cleaner

      Returns void

    • Parameters

      • ...ags: unknown[]

      Returns void

    • Parameters

      • ...ags: unknown[]

      Returns void