Exemple #1
0
        public async Task <T> Retry <T>(Func <Task <T> > func, RetryMechanismOptions retryMechanismOptions)
        {
            IRetryMechanismStrategy retryMechanism = null;

            if (retryMechanismOptions.RetryPolicies == RetryPolicies.Linear)
            {
                retryMechanism = new RetryLinearMechanismStrategy(retryMechanismOptions);
            }

            return(await retryMechanism.ExecuteAsync(func));
        }
 public RetryExponentiallyMechanismStrategy(RetryMechanismOptions retryMechanismOptions)
     : base(retryMechanismOptions)
 {
     _retryMechanismOptions = retryMechanismOptions;
 }
Exemple #3
0
 public RetryMechanismBase(RetryMechanismOptions retryMechanismOptions)
 {
     _retryMechanismOptions = retryMechanismOptions;
 }
Exemple #4
0
 public RetryLinearMechanismStrategy(RetryMechanismOptions retryMechanismOptions)
     : base(retryMechanismOptions)
 {
     _retryMechanismOptions = retryMechanismOptions;
 }