public Policy GetPolicy(PolicyBuilder policyBuilder)
 {
     return(policyBuilder.AdvancedCircuitBreaker(_failureThreshold, TimeSpan.FromMilliseconds(_samplingDuration), _minimumThroughput, TimeSpan.FromMilliseconds(_durationOfBreak),
                                                 onBreak: (x, y) => _logger.LogException(new Exception("Advanced Breaker logging: Breaking the circuit for " + y.TotalMilliseconds + " ms!", x)),
                                                 onReset: () => _logger.LogMessage("Advanced Breaker logging: Call ok! Closed the circuit again!"),
                                                 onHalfOpen: () => _logger.LogMessage("Advanced Breaker logging: Half-open: Next call is a trial!")));
 }
 public Policy CreatePolicy(PolicyBuilder policyBuilder) =>
 policyBuilder.AdvancedCircuitBreaker(_failureThreshold, _samplingDuration, _minimumThroughput, _durationOfBreak);