انتقل إلى المحتوى الرئيسي

Type Alias: IdempotencyHook

IdempotencyHook = (info, execute) => Promise<Reply<unknown>>

Defined in: packages/messaging/src/ports.ts:227

Wraps the execution of a mutation. The service implements it against its idempotency_key table: it looks the key up, and either returns the replay (re-reading the aggregate; the row holds a response hash and an aggregate reference, never a body) or calls execute and records the outcome in the same transaction as the mutation. This package decides only WHEN it applies (every mutation) and WHERE (after scope is minted, before the handler).

Parameters​

info​

IdempotencyInfo

execute​

() => Promise<Reply<unknown>>

Returns​

Promise<Reply<unknown>>