Class ChaosStrategy
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
ChaosStrategyOptionsThe 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
ResilienceContextThe 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.