ws-asyncapi API / core / IdempotencyCache
Class: IdempotencyCache
Defined in: .api-entries/core/index.d.ts:554
Bounded, TTL'd store mapping idempotency key → settled RPC outcome. The first call for a key runs exec; subsequent calls (in-flight or completed) get the same outcome without re-running it.
Constructors
Constructor
new IdempotencyCache(
options?):IdempotencyCache
Defined in: .api-entries/core/index.d.ts:556
Parameters
options?
Returns
IdempotencyCache
Methods
run()
run(
key,exec):Promise<CachedRpc>
Defined in: .api-entries/core/index.d.ts:562
Run exec exactly once for key; duplicates resolve to the same outcome. exec must not throw — it returns a CachedRpc for both success and failure so failures are cached identically (a retry sees the same error).
Parameters
key
string
exec
() => Promise<CachedRpc>
Returns
Promise<CachedRpc>
clear()
clear():
void
Defined in: .api-entries/core/index.d.ts:564
Drop everything (e.g. on shutdown).
Returns
void