iya-sts
    Preparing search index...

    Class export=<K, V>

    A bounded cache in least-recently-used order, with pinning and an optional description on /admin/caches (#349).

    A read (get) moves a key to the young end; an insert past the bound drops unpinned keys from the old end.

    Type Parameters

    • K
    • V
    Index
    • Builds the cache and, when a registry is given, describes it there.

      Type Parameters

      • K
      • V

      Parameters

      • options: BoundedLruOptions<K>

        the name, the bound, and the registry's description

      Returns export=<K, V>

      an Error when the name or the bound is missing

    • Drops every key and every pin. The counters are kept: they are about the life of the process, as every registered cache's are.

      Returns void

    • Drops a key, and any pins on it.

      Parameters

      • key: K

        the key

      Returns boolean

      true when it was held

    • Reads a key, counting a hit or a miss and making it the most recently used.

      Parameters

      • key: K

        the key

      Returns V

      the value, or undefined when it is not held

    • Whether a key is held. Neither counted nor a use.

      Parameters

      • key: K

        the key

      Returns boolean

      true when held

    • Whether a key is pinned.

      Parameters

      • key: K

        the key

      Returns boolean

      true when at least one pin is held on it

    • Answers the bound now, as a whole number of at least one.

      Returns number

      the bound

    • Reads a key without counting it or changing its recency.

      Parameters

      • key: K

        the key

      Returns V

      the value, or undefined when it is not held

    • Keeps a key from being evicted until it is unpinned as many times.

      Parameters

      • key: K

        the key

      Returns void

    • Puts a value under a key as the most recently used, then evicts unpinned keys from the old end until the cache is within its bound.

      Parameters

      • key: K

        the key

      • value: V

        the value

      Returns this

      this cache

    • The cache's figures, for a status page and for tests.

      Returns BoundedLruStats

      size, bound, pins, overrun and the counters

    • Releases one pin on a key, and evicts if the cache is over its bound.

      Parameters

      • key: K

        the key

      Returns void