Skip to content

IVersionedCache

Defined in: packages/ddd-core/application/ports/cache.port.ts:92

Extended cache port providing atomic revision-fenced state operations.

Guarantees per-key ordering: a fill started before an observed invalidation cannot repopulate its key afterwards.

T = unknown

Value shape stored by this cache adapter.

readonly isVersioned: true

Defined in: packages/ddd-core/application/ports/cache.port.ts:93

delete(key): Promise<void>

Defined in: packages/ddd-core/application/ports/cache.port.ts:45

Removes key when present.

string

Promise<void>

ICache.delete


get(key): Promise<T | undefined>

Defined in: packages/ddd-core/application/ports/cache.port.ts:39

Returns the cached value, or undefined when the key is absent.

string

Promise<T | undefined>

ICache.get


invalidate(key): Promise<string>

Defined in: packages/ddd-core/application/ports/cache.port.ts:105

Atomically advances the key revision and evicts the value.

string

Promise<string>

The newly advanced revision.


readState(key): Promise<CacheStateEntry<T>>

Defined in: packages/ddd-core/application/ports/cache.port.ts:98

Observes current key state and opaque revision token.

string

Promise<CacheStateEntry<T>>


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

Defined in: packages/ddd-core/application/ports/cache.port.ts:42

Writes a value under key, optionally with TTL/CAS semantics.

string

T

CacheSetOptions

Promise<void>

ICache.set


tryFill(key, observedRevision, value, options?): Promise<boolean>

Defined in: packages/ddd-core/application/ports/cache.port.ts:113

Atomically checks that current revision matches observedRevision, writes value, and advances revision on match.

string

string

T

CacheFillOptions

Promise<boolean>

true if write committed; false if rejected due to revision mismatch.