resilience
resilience(
options):PipelineBehaviorTuple<ResilienceBehavior,ResilienceBehaviorOptions>
Defined in: packages/pipeline-resilience/src/helpers/resilience.intent.ts:30
Returns a resilience behavior entry for pipeline.wrap() or createPipeline({ globalBehaviors }).
Parameters
Section titled “Parameters”options
Section titled “options”At least one policy, plus optional classification and telemetry.
Returns
Section titled “Returns”PipelineBehaviorTuple<ResilienceBehavior, ResilienceBehaviorOptions>
The behavior class and options tuple. Runtime safety checks still apply:
retries on commands/events require retry.replaySafe: true; configure handle
to select retryable errors unless classification is supplied by the constructor defaults.
Example
Section titled “Example”@pipeline.wrap({ kind: 'command' }, resilience({ handle: (error) => error instanceof TransientGatewayError, retry: { maxAttempts: 3, replaySafe: true }, timeout: { duration: 5_000 },}))