Skip to main content
zerotal

Documentation


Documentation / @zerotal/flow / index / DurableStore

Interface: DurableStore

Defined in: flow/src/durable.ts:70

Pluggable backing store for durable component snapshots.

Remarks

The default MemoryDurableStore keeps entries in-process with TTL eviction — durable across reconnect/tab-close/device-switch within the process lifetime, but lost on redeploy. Swap a persistent backend (e.g. @zerotal/cache/Redis) via setDurableStore to also survive redeploys. Methods may be sync or async; a swapped store is responsible for its own TTL eviction (the ttlMs hint is passed to set).

Methods

get()

get(key): Snapshot | Promise<Snapshot | undefined> | undefined

Defined in: flow/src/durable.ts:72

Fetch a stored snapshot by key, or undefined if absent/expired.

Parameters

key

string

Returns

Snapshot | Promise<Snapshot | undefined> | undefined


set()

set(key, value, ttlMs?): void | Promise<void>

Defined in: flow/src/durable.ts:74

Store a snapshot under key, expiring after ttlMs if supported.

Parameters

key

string

value

Snapshot

ttlMs?

number

Returns

void | Promise<void>


delete()

delete(key): void | Promise<void>

Defined in: flow/src/durable.ts:76

Remove a stored snapshot (used on flow completion via clearDurable()).

Parameters

key

string

Returns

void | Promise<void>