| | | 1 | | using Intentum.Runtime.Resilience.Bulkhead; |
| | | 2 | | using Intentum.Runtime.Resilience.CircuitBreaker; |
| | | 3 | | using Intentum.Runtime.Resilience.Degradation; |
| | | 4 | | using Intentum.Runtime.Resilience.Retry; |
| | | 5 | | using Intentum.Runtime.Resilience.Timeout; |
| | | 6 | | using Microsoft.Extensions.DependencyInjection; |
| | | 7 | | |
| | | 8 | | namespace Intentum.Runtime.Resilience; |
| | | 9 | | |
| | | 10 | | public static class ResilienceExtensions |
| | | 11 | | { |
| | | 12 | | public static IServiceCollection AddIntentumResilience( |
| | | 13 | | this IServiceCollection services, |
| | | 14 | | CircuitBreakerOptions? circuitBreaker = null, |
| | | 15 | | RetryOptions? retry = null, |
| | | 16 | | BulkheadOptions? bulkhead = null, |
| | | 17 | | DegradationOptions? degradation = null, |
| | | 18 | | TimeoutOptions? timeout = null) |
| | 0 | 19 | | { |
| | 0 | 20 | | services.AddIntentumCircuitBreaker(circuitBreaker); |
| | 0 | 21 | | services.AddIntentumRetryPolicy(retry); |
| | 0 | 22 | | services.AddIntentumBulkhead(bulkhead); |
| | 0 | 23 | | services.AddIntentumDegradationPolicy(degradation); |
| | 0 | 24 | | services.AddIntentumTimeoutPolicy(timeout); |
| | 0 | 25 | | return services; |
| | 0 | 26 | | } |
| | | 27 | | } |