TestimoX

API Reference

Class

CircuitBreaker

Namespace TestimoX.Infrastructure
Assembly TestimoX

Simple circuit breaker implementation for monitoring Active Directory connectivity.

Inheritance

  • Object
  • CircuitBreaker

Constructors

public CircuitBreaker(Int32 failureThreshold = 3, Nullable<TimeSpan> openDuration = null) #

Creates a new circuit breaker.

Parameters

failureThreshold System.Int32 = 3 optionalposition: 0
Number of consecutive failures before opening.
openDuration System.Nullable{System.TimeSpan} = null optionalposition: 1
Time to stay open before allowing retries.

Methods

public Boolean AllowRequest() #
Returns: Boolean

Determines whether execution is allowed.

public Void RecordFailure() #
Returns: Void

Records a failed operation and opens the breaker if threshold exceeded.

public Void RecordSuccess() #
Returns: Void

Records a successful operation and closes the breaker if needed.