public AsyncExecution(
     Func <Task <TResult> > taskFunc,
     ShouldRetryHandler shouldRetryHandler,
     Func <Exception, bool> isTransient,
     Action <int, Exception, TimeSpan> onRetrying,
     bool fastFirstRetry,
     CancellationToken cancellationToken)
 {
     _taskFunc           = taskFunc;
     _shouldRetryHandler = shouldRetryHandler;
     _isTransient        = isTransient;
     _onRetrying         = onRetrying;
     _fastFirstRetry     = fastFirstRetry;
     _cancellationToken  = cancellationToken;
 }
Exemple #2
0
 protected override void Act()
 {
     this.retryStrategy = new IncrementalRetryStrategy("name", 5, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(2));
     this.shouldRetry   = this.retryStrategy.GetShouldRetryHandler();
 }
Exemple #3
0
 protected override void Act()
 {
     this.retryStrategy = new IncrementalRetryStrategy();
     this.shouldRetry   = this.retryStrategy.GetShouldRetryHandler();
 }
Exemple #4
0
 protected override void Act()
 {
     this.retryStrategy = new ExponentialBackoffRetryStrategy("name", 5, TimeSpan.FromSeconds(5), TimeSpan.FromMinutes(5), TimeSpan.FromSeconds(10));
     this.shouldRetry   = this.retryStrategy.GetShouldRetryHandler();
 }
Exemple #5
0
 protected override void Act()
 {
     this.retryStrategy = new ExponentialBackoffRetryStrategy();
     this.shouldRetry   = this.retryStrategy.GetShouldRetryHandler();
 }
 protected override void Act()
 {
     this.retryStrategy = new FixedIntervalRetryStrategy(5);
     this.shouldRetry   = this.retryStrategy.GetShouldRetryHandler();
 }
 protected override void Act()
 {
     this.retryStrategy = new FixedIntervalRetryStrategy("name", 5, TimeSpan.FromSeconds(5));
     this.shouldRetry   = this.retryStrategy.GetShouldRetryHandler();
 }