public CircuitBreakerPolicyHandler(LoggingSettings loggingSettings, CircuitBreakerSettings settings, HttpMessageHandler inner)
            : base(inner)
        {
            _loggingSettings = loggingSettings;
            _circuitBreakerEnabled = settings.CircuitBreakerEnabled;

            _circuitBreaker = Policy
            .Handle<Exception>()
            .CircuitBreakerAsync(settings.ExceptionAllowedBeforeCircuitBroken, TimeSpan.FromMilliseconds(settings.DurationOfCircuitBreakMiliseconds));
        }
        public DefaultRefitSettings()
        {
            LoggingSettings = new LoggingSettings();
            CircuitBreakerSettings = new CircuitBreakerSettings();
            RetryPolicySettings = new RetryPolicySettings();

            HttpMessageHandlerFactory = () =>
            {
                var handlers = new LoggingHandler(
                    LoggingSettings,
                    new CircuitBreakerPolicyHandler(LoggingSettings, CircuitBreakerSettings,
                        new RetryPolicyHandler(LoggingSettings, RetryPolicySettings,
                            new NoOpHandler())));

                return handlers;
            };
        }