Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AsyncCache<K, T, I>

An async cache is cache which stores collections of items that are built over time. Writers will call the update and commit method to update the cache content & mark items as available.

author

Thomas Minier

Type parameters

  • K

  • T

  • I

Hierarchy

Implemented by

Index

Methods

commit

  • commit(key: K, writerID: I): void

count

  • count(): number

delete

  • delete(key: K, writerID: I): void

get

  • get(key: K): Promise<T[]> | null
  • Access an item by its key. Each call to get() should be predated by a call to has() to check if the item is in the cache.

    Parameters

    • key: K

      Item's key

    Returns Promise<T[]> | null

    The values of the item with the given key, or null if it was not found

has

  • has(key: K): boolean
  • Test if the cache contains an item with a given key

    Parameters

    • key: K

      Item's key

    Returns boolean

    True if the cache contains the item with the given key, False otherwise

update

  • update(key: K, item: T, writerID: I): void

Generated using TypeDoc