Skip to content

Rapid Failure Protection - How to implement #2022

Answered by peter-csala
mhsimkin asked this question in Q&A
Discussion options

You must be logged in to vote

Let me share with you my prototype:

  1. Let's define a custom ResilienceStrategyOptions to capture the parameters of the cyclic retry
public class CyclicRetryStrategyOptions: ResilienceStrategyOptions
{
    public TimeSpan CycleLength {get; set;} = TimeSpan.FromSeconds(10);
    public TimeSpan BaseDelay {get; set;} = TimeSpan.FromSeconds(1);
    public ResiliencePropertyKey<DateTime> CycleStartKey {get;} = new(nameof(CycleStartKey));
}
  1. Let's define a custom ResilienceStrategy to set the cycle start
public sealed class CycleStartStrategy: ResilienceStrategy
{
    private readonly CyclicRetryStrategyOptions options;

    public CycleStartStrategy(CyclicRetryStrategyOptions options)
    {

Replies: 4 comments 13 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@peter-csala
Comment options

@mhsimkin
Comment options

Comment options

You must be logged in to vote
4 replies
@mhsimkin
Comment options

@peter-csala
Comment options

@peter-csala
Comment options

@mhsimkin
Comment options

Comment options

You must be logged in to vote
7 replies
@peter-csala
Comment options

@mhsimkin
Comment options

@peter-csala
Comment options

Answer selected by mhsimkin
@peter-csala
Comment options

@mhsimkin
Comment options

@mhsimkin
Comment options

@mhsimkin
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants