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

CircuitStateController<TResult>

abstract class CircuitStateController<TResult> : ICircuitController<TResult>
protected long _blockedTill

protected readonly TimeSpan _durationOfBreak

protected DelegateResult<TResult> _lastOutcome

protected readonly object _lock

protected readonly Action<DelegateResult<TResult>, CircuitState, TimeSpan, Context> _onBreak

protected readonly Action _onHalfOpen

protected readonly Action<Context> _onReset

public CircuitState CircuitState { get; }

protected bool IsInAutomatedBreak_NeedsLock { get; }

public Exception LastException { get; }

public TResult LastHandledResult { get; }

protected CircuitStateController(TimeSpan durationOfBreak, Action<DelegateResult<TResult>, CircuitState, TimeSpan, Context> onBreak, Action<Context> onReset, Action onHalfOpen)

protected void Break_NeedsLock(Context context)

public void Isolate()

public abstract void OnActionFailure(DelegateResult<TResult> outcome, Context context)

public void OnActionPreExecute()

public abstract void OnActionSuccess(Context context)

public abstract void OnCircuitReset(Context context)

protected bool PermitHalfOpenCircuitTest()

public void Reset()

protected void ResetInternal_NeedsLock(Context context)