Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ReactiveExpirationPolicy<Key, Value, ArgumentsBundle>

Expiration policy which evicts keys when they are requested.
When Cache.get operation is performed, policy will check if key it's expired and if so, will evict it from cache, returning undefined to clients.
This kind of policy can be used if you have keys that will be often queried, so the cache won't be polluted with expired entries that weren't queried for long time. To solve the latest problem, you can use an additional LRU/LFU policy.

Type parameters

Hierarchy

  • AbsoluteExpirationPolicy<Key, Value, ArgumentsBundle>
    • ReactiveExpirationPolicy

Constructors

constructor

Methods

onClear

  • onClear(): void
  • inheritdoc

    Returns void

onDelete

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

    Parameters

    • entry: ExpirableCacheEntry<Key, Value>

    Returns void

onHit

  • inheritdoc

    Parameters

    • entry: ExpirableCacheEntry<Key, Value>

    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