This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RescheduleStrategy | |
{ | |
private const string RetryAttemptPropertyName = "retry-attempt"; | |
private const int MaxRetryAttempts = 5; | |
private const int Exponent = 2; | |
private readonly Random _random = new Random(); | |
private readonly IQueueClient _queueClientImplementation; | |
private readonly TimeSpan _initialDelay = TimeSpan.FromSeconds(5); | |
public async Task ScheduleRetryAsync(Message message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Polly; | |
using Polly.CircuitBreaker; | |
public class CircuitBreakerHandler | |
{ | |
private readonly IEmailService _emailService; | |
private readonly ILogger _logger; | |
private CircuitBreakerPolicy _circuitBreaker; | |
public CircuitBreakerHandler(IEmailService emailService, ILogger logger) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FireAndForgetHandler | |
{ | |
private readonly IEmailService _emailService; | |
private readonly ILogger _logger; | |
public FireAndForgetHandler(IEmailService emailService, ILogger logger) | |
{ | |
_emailService = emailService; | |
_logger = logger; | |
} |