Skip to main content
Version: Current

Cache

@rotorsoft/act-root


@rotorsoft/act-root / act/src / Cache

Interface: Cache

Defined in: libs/act/src/types/ports.ts:1385

Cache port for storing stream snapshots in-process.

Implementations should provide fast key-value access with bounded memory. The async interface is forward-compatible with external caches (e.g., Redis).

Template​

TState

The state schema type

Extends​

Properties​

dispose​

dispose: Disposer

Defined in: libs/act/src/types/ports.ts:27

Inherited from​

Disposable.dispose

Methods​

clear()​

clear(): Promise<void>

Defined in: libs/act/src/types/ports.ts:1394

Returns​

Promise<void>


get()​

get<TState>(stream): Promise<CacheEntry<TState> | undefined>

Defined in: libs/act/src/types/ports.ts:1386

Type Parameters​

TState​

TState extends Schema

Parameters​

stream​

string

Returns​

Promise<CacheEntry<TState> | undefined>


invalidate()​

invalidate(stream): Promise<void>

Defined in: libs/act/src/types/ports.ts:1393

Parameters​

stream​

string

Returns​

Promise<void>


set()​

set<TState>(stream, entry): Promise<void>

Defined in: libs/act/src/types/ports.ts:1389

Type Parameters​

TState​

TState extends Schema

Parameters​

stream​

string

entry​

CacheEntry<TState>

Returns​

Promise<void>