Class ChaosBehaviorPipelineBuilderExtensions
Extension methods for adding chaos behaviors to a ResiliencePipelineBuilder.
public static class ChaosBehaviorPipelineBuilderExtensions
- Inheritance
-
ChaosBehaviorPipelineBuilderExtensions
- Inherited Members
Methods
AddChaosBehavior<TBuilder>(TBuilder, ChaosBehaviorStrategyOptions)
Adds a behavior chaos strategy to the builder.
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "All options members preserved.")]
public static TBuilder AddChaosBehavior<TBuilder>(this TBuilder builder, ChaosBehaviorStrategyOptions options) where TBuilder : ResiliencePipelineBuilderBase
Parameters
builderTBuilderThe builder instance.
optionsChaosBehaviorStrategyOptionsThe behavior options.
Returns
- TBuilder
The same builder instance.
Type Parameters
TBuilderThe builder type.
Exceptions
- ArgumentNullException
Thrown when
builderoroptionsis null.- ValidationException
Thrown when
optionsare invalid.
AddChaosBehavior<TBuilder>(TBuilder, double, Func<CancellationToken, ValueTask>)
Adds a behavior chaos strategy to the builder.
public static TBuilder AddChaosBehavior<TBuilder>(this TBuilder builder, double injectionRate, Func<CancellationToken, ValueTask> behavior) where TBuilder : ResiliencePipelineBuilderBase
Parameters
builderTBuilderThe builder instance.
injectionRatedoubleThe injection rate for a given execution, which the value should be between [0, 1] (inclusive).
behaviorFunc<CancellationToken, ValueTask>The behavior to be injected.
Returns
- TBuilder
The same builder instance.
Type Parameters
TBuilderThe builder type.
Exceptions
- ArgumentNullException
Thrown when
builderis null.- ValidationException
Thrown when the options produced from the arguments are invalid.