public void Register(
     string policy,
     ICircuitBreakerAnalyser circuitBreakerAnalyser,
     ICircuitBreakerOpeningRates circuitBreakerOpeningRates,
     ICircuitBreakerPeriod circuitBreakerPeriod)
 {
     throw new System.NotImplementedException();
 }
Example #2
0
 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));
 }
Example #3
0
        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));
        }