Table of Contents

Class ChaosBehaviorPipelineBuilderExtensions

Namespace
Polly.Simmy
Assembly
Polly.Core.dll

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 TBuilder

The builder instance.

options ChaosBehaviorStrategyOptions

The behavior options.

Returns

TBuilder

The same builder instance.

Type Parameters

TBuilder

The builder type.

Exceptions

ArgumentNullException

Thrown when builder or options 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 TBuilder

The builder instance.

injectionRate double

The 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.