public static IHttpClient AddCircuitBreaking( this IHttpClient httpClient, IHttpApiWithCircuitBreaking httpApiWithCircuitBreaking, ICircuitBreakerManager circuitBreakerManager) { return(new CircuitBreakingHttpClient( httpClient, circuitBreakerManager.GetState(httpApiWithCircuitBreaking.CircuitBreakerPolicy))); }
public SmsMessageService(ILogger <SmsMessageService> logger, ISmsMessageRepository repository, ISmsNotification smsNotification, IDateTimeProvider dateTimeProvider, ICircuitBreakerManager circuitBreakerManager, IDistributedLock distributedLock) { _logger = logger; _repository = repository; _smsNotification = smsNotification; _dateTimeProvider = dateTimeProvider; _circuitBreakerManager = circuitBreakerManager; _distributedLock = distributedLock; }
public EmailMessageService(ILogger <EmailMessageService> logger, IEmailMessageRepository repository, IEmailNotification emailNotification, IDateTimeProvider dateTimeProvider, ICircuitBreakerManager circuitBreakerManager, IDistributedLock distributedLock) { _logger = logger; _repository = repository; _emailNotification = emailNotification; _dateTimeProvider = dateTimeProvider; _circuitBreakerManager = circuitBreakerManager; _distributedLock = distributedLock; }
public BetterController(ILogger <BetterController> logger, ICircuitBreakerManager circuitBreakerManager) { _logger = logger; _circuitBreakerManager = circuitBreakerManager; var policy = Policy.Handle <Exception>() .AdvancedCircuitBreakerAsync(failureThreshold: 0.5, samplingDuration: TimeSpan.FromMinutes(2), minimumThroughput: 2, durationOfBreak: TimeSpan.FromMinutes(5), onBreak: (Exception e, TimeSpan span) => { _logger.LogError("Policy did break"); }, onReset: () => { _logger.LogInformation("Policy did reset"); }); var isAdded = _circuitBreakerManager.TryAdd(PolicyName, policy); //True on the first request, False on subsequent requests _logger.LogInformation($"Has the policy been added? {isAdded.ToString()}"); }
public IdealController(ILogger <IdealController> logger, ICircuitBreakerManager circuitBreakerManager) { _logger = logger; _circuitBreakerManager = circuitBreakerManager; }
public CircuitBreakerHostedService(ICircuitBreakerManager circuitBreakerManager) { _circuitBreakerManager = circuitBreakerManager; }
public ManagementController(ILogger <ManagementController> logger, ICircuitBreakerManager circuitBreakerManager) { _logger = logger; _circuitBreakerManager = circuitBreakerManager; }
public CircuitBreakerController(ICircuitBreakerManager circuitBreakerManager) { this.circuitBreakerManager = circuitBreakerManager; }
public CircuitBreakingHttpClientDecorator(ICircuitBreakerManager circuitBreakerManager) { _circuitBreakerManager = circuitBreakerManager; }
public CircuitBreakerStateCollector(ICircuitBreakerManager circuitBreakerManager) { _circuitBreakerManager = circuitBreakerManager; }