Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ProactiveExpirationPolicy<Key, Value, ArgumentsBundle>

Expiration policy which evicts keys on it's behalf in the background.
Expired keys are tracked with the help of GarbageCollector, which evicts them asynchronously when they expire.
This kind of policy can be used if you have keys that won't be often queried and you need a background timer which evicts keys as soon as they expire.

Type parameters

Hierarchy

  • AbsoluteExpirationPolicy<Key, Value, ArgumentsBundle>
    • ProactiveExpirationPolicy

Constructors

constructor

Accessors

size

  • get size(): number
  • Get the number of tracked for expiration keys.

    Returns number

Methods

isIdle

  • isIdle(): boolean
  • Method used for unit testing purposes!

    Returns boolean

onClear

  • onClear(): void
  • inheritdoc

    Returns void

onDelete

  • onDelete(entry: ExpirableCacheEntry<Key, Value>): void
  • inheritdoc

    Parameters

    • entry: ExpirableCacheEntry<Key, Value>

    Returns void

onHit

  • inheritdoc

    Returns EntryValidity

onMiss

  • onMiss(): void
  • inheritdoc

    Returns void

onSet

  • onSet(entry: ExpirableCacheEntry<Key, Value>, options?: ArgumentsBundle): void
  • inheritdoc

    Parameters

    • entry: ExpirableCacheEntry<Key, Value>
    • Optional options: ArgumentsBundle

    Returns void

onUpdate

  • onUpdate(entry: ExpirableCacheEntry<Key, Value>, options?: ArgumentsBundle): void
  • inheritdoc

    Parameters

    • entry: ExpirableCacheEntry<Key, Value>
    • Optional options: ArgumentsBundle

    Returns void

setDeleter

  • setDeleter(deleter: Deleter<Key, Value>): void
  • inheritdoc

    Parameters

    Returns void