public void Register( string policy, ICircuitBreakerAnalyser circuitBreakerAnalyser, ICircuitBreakerOpeningRates circuitBreakerOpeningRates, ICircuitBreakerPeriod circuitBreakerPeriod) { throw new System.NotImplementedException(); }
public CircuitBreakerState( string policy, ICircuitBreakerAnalyser circuitBreakerAnalyser, ICircuitBreakerOpeningRates circuitBreakerOpeningRates, ICircuitBreakerPeriod circuitBreakerPeriod) { Policy = policy; _circuitBreakerAnalyser = circuitBreakerAnalyser ?? throw new ArgumentNullException(nameof(circuitBreakerAnalyser)); _circuitBreakerOpeningRates = circuitBreakerOpeningRates ?? throw new ArgumentNullException(nameof(circuitBreakerOpeningRates)); _circuitBreakerPeriod = circuitBreakerPeriod ?? throw new ArgumentNullException(nameof(circuitBreakerPeriod)); }
public void Register( string policy, ICircuitBreakerAnalyser circuitBreakerAnalyser, ICircuitBreakerOpeningRates circuitBreakerOpeningRates, ICircuitBreakerPeriod circuitBreakerPeriod) { var circuitBreakingState = new CircuitBreakerState(policy, circuitBreakerAnalyser, circuitBreakerOpeningRates, circuitBreakerPeriod); var task = Task.Run(() => circuitBreakingState.MonitorAsync(_stoppingCts.Token)); _cache.Add(policy, new Entry(circuitBreakingState, task)); }