Version: 4.3

Class: MemoryCacheAdapter

Hierarchy

  • MemoryCacheAdapter

Implements

Constructors

constructor

+ new MemoryCacheAdapter(options: { expiration: number }): MemoryCacheAdapter

Defined in packages/core/src/cache/MemoryCacheAdapter.ts:5

Parameters:

NameType
options{ expiration: number }

Returns: MemoryCacheAdapter

Properties

data

Private Readonly data: Map<string, { data: any ; expiration: number }> = new Map<string, { data: any; expiration: number }>()

Defined in packages/core/src/cache/MemoryCacheAdapter.ts:5


options

Private Readonly options: { expiration: number }

Defined in packages/core/src/cache/MemoryCacheAdapter.ts:7

Type declaration:

NameType
expirationnumber

Methods

clear

clear(): Promise<void>

Implementation of CacheAdapter

Defined in packages/core/src/cache/MemoryCacheAdapter.ts:36

Clears all items stored in the cache.

Returns: Promise<void>


get

get<T>(name: string): Promise<T | undefined>

Implementation of CacheAdapter

Defined in packages/core/src/cache/MemoryCacheAdapter.ts:12

Gets the items under name key from the cache.

Type parameters:

NameDefault
Tany

Parameters:

NameType
namestring

Returns: Promise<T | undefined>


set

set(name: string, data: any, origin: string, expiration?: number): Promise<void>

Implementation of CacheAdapter

Defined in packages/core/src/cache/MemoryCacheAdapter.ts:29

Sets the item to the cache. origin is used for cache invalidation and should reflect the change in data.

Parameters:

NameType
namestring
dataany
originstring
expiration?number

Returns: Promise<void>

Last updated on by Martin Adámek