idempotent
Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.
idempotent(
options):PipelineBehaviorTuple<IdempotencyBehavior,IdempotencyBehaviorOptions>
Defined in: packages/pipeline-idempotency/src/helpers/idempotency.intent.ts:38
Returns an idempotency behavior entry for pipeline.wrap() or createPipeline({ globalBehaviors }).
Parameters
Section titled “Parameters”options
Section titled “options”A key factory and idempotency options, or inheritModuleKey: true
when the behavior’s constructor defaults supply the key factory. The inheritance marker is not
forwarded to the behavior and does not validate module configuration.
Returns
Section titled “Returns”PipelineBehaviorTuple<IdempotencyBehavior, IdempotencyBehaviorOptions>
The behavior class and options tuple. Keys must distinguish operations and any tenant/principal scope that changes the authorized response; a shared key can replay another caller’s response.
Example
Section titled “Example”export const createUser = pipeline.wrap( { name: 'createUser', kind: 'command' }, idempotent({ keyFactory: createUserKey, ttl: 86_400_000 }),)(users.create);
// The key factory comes from the IdempotencyBehavior constructor defaults.const entry = idempotent({ inheritModuleKey: true });