Table of Contents

Class ChaosStrategy

Namespace
Polly.Simmy
Assembly
Polly.Core.dll

Base class for chaos strategies.

public abstract class ChaosStrategy : ResilienceStrategy
Inheritance
ChaosStrategy
Inherited Members

Constructors

ChaosStrategy(ChaosStrategyOptions)

Initializes a new instance of the ChaosStrategy class.

protected ChaosStrategy(ChaosStrategyOptions options)

Parameters

options ChaosStrategyOptions

The chaos strategy options.

Methods

ShouldInjectAsync(ResilienceContext)

Determines whether or not the chaos strategy should be injected based on the injection rate and enabled flag.

protected ValueTask<bool> ShouldInjectAsync(ResilienceContext context)

Parameters

context ResilienceContext

The ResilienceContext instance.

Returns

ValueTask<bool>

A boolean value that indicates whether or not the chaos strategy should be injected.

Remarks

Use this method before injecting any chaos strategy to evaluate whether a given chaos strategy needs to be injected during the execution.