Options
All
  • Public
  • Public/Protected
  • All
Menu

Cache for RunningStates. Two buckets here: volatile and durable. Volatile is a LRUMap with a definite limit. Durable bucket is just a simple map. One is expected to free a durable value when it is no longer needed.

Type parameters

  • T

Hierarchy

  • StateCache

Implements

  • Iterable<[string, T]>

Index

Constructors

constructor

  • new StateCache(limit: number, onEvicted?: (item: T) => void): StateCache

Properties

Readonly durable

durable: Map<string, T>

Readonly volatile

volatile: LRUMap<string, T>

Methods

[Symbol.iterator]

  • [Symbol.iterator](): Generator<[string, T], any, unknown>

delete

  • delete(key: string): void

endure

  • endure(key: string, value: T): void

entries

  • entries(): Generator<[string, T]>

free

  • free(key: string): void

get

  • get(key: string): T | undefined

keys

  • keys(): Generator<string>

set

  • set(key: string, value: T): void

values

  • values(): Generator<T>