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.
public static TBuilder AddChaosBehavior<TBuilder>(this TBuilder builder, ChaosBehaviorStrategyOptions options) where TBuilder : ResiliencePipelineBuilderBase
Parameters
builder
TBuilderThe builder instance.
options
ChaosBehaviorStrategyOptionsThe behavior options.
Returns
- TBuilder
The same builder instance.
Type Parameters
TBuilder
The builder type.
Exceptions
- ArgumentNullException
Thrown when
builder
oroptions
is null.- ValidationException
Thrown when
options
are 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
builder
TBuilderThe builder instance.
injectionRate
doubleThe injection rate for a given execution, which the value should be between [0, 1] (inclusive).
behavior
Func<CancellationToken, ValueTask>The behavior to be injected.
Returns
- TBuilder
The same builder instance.
Type Parameters
TBuilder
The builder type.
Exceptions
- ArgumentNullException
Thrown when
builder
is null.- ValidationException
Thrown when the options produced from the arguments are invalid.