<PackageReference Include="Polly" Version="4.3.0" />

CircuitBreakerPolicy<TResult>

public class CircuitBreakerPolicy<TResult> : ContextualPolicy<TResult>
A circuit-breaker policy that can be applied to delegates returning a value of type .
public CircuitState CircuitState { get; }

Gets the state of the underlying circuit.

public Exception LastException { get; }

Gets the last exception handled by the circuit-breaker.

public TResult LastHandledResult { get; }

Gets the last result returned from a user delegate which the circuit-breaker handled.

public void Isolate()

Isolates (opens) the circuit manually, and holds it in this state until a call to Reset is made.

public void Reset()

Closes the circuit, and resets any statistics controlling automated circuit-breaking.