Class CircuitBreakerSettings
- Namespace
- WorkflowForge.Extensions.Resilience.Configurations
- Assembly
- WorkflowForge.Extensions.Resilience.dll
Configuration settings for circuit breaker behavior in WorkflowForge operations.
public sealed class CircuitBreakerSettings : IValidatableObject
- Inheritance
-
CircuitBreakerSettings
- Implements
- Inherited Members
Properties
FailureThreshold
Gets or sets the failure threshold to open the circuit.
[Range(1, 1000, ErrorMessage = "FailureThreshold must be between 1 and 1000")]
public int FailureThreshold { get; set; }
Property Value
HalfOpenTestRequests
Gets or sets the number of test requests in half-open state.
[Range(1, 100, ErrorMessage = "HalfOpenTestRequests must be between 1 and 100")]
public int HalfOpenTestRequests { get; set; }
Property Value
IsEnabled
Gets or sets a value indicating whether circuit breaker is enabled.
public bool IsEnabled { get; set; }
Property Value
OpenDuration
Gets or sets the duration to keep the circuit open.
[Range(typeof(TimeSpan), "00:00:01", "01:00:00", ErrorMessage = "OpenDuration must be between 1 second and 1 hour")]
public TimeSpan OpenDuration { get; set; }
Property Value
TimeWindow
Gets or sets the time window for failure counting.
[Range(typeof(TimeSpan), "00:00:01", "01:00:00", ErrorMessage = "TimeWindow must be between 1 second and 1 hour")]
public TimeSpan TimeWindow { get; set; }
Property Value
Methods
Clone()
Creates a deep copy of the current circuit breaker settings.
public CircuitBreakerSettings Clone()
Returns
- CircuitBreakerSettings
A new CircuitBreakerSettings instance with copied values.
Validate(ValidationContext)
Validates the circuit breaker settings.
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
Parameters
validationContextValidationContextThe validation context.
Returns
- IEnumerable<ValidationResult>
A collection of validation results.