Class PollyRetryTemplate
public class PollyRetryTemplate : RetryTemplate, IRetryOperation
- Inheritance
-
PollyRetryTemplate
- Implements
- Inherited Members
Constructors
PollyRetryTemplate(Dictionary<Type, bool>, int, bool, int, int, double, ILogger)
public PollyRetryTemplate(Dictionary<Type, bool> retryableExceptions, int maxAttempts, bool defaultRetryable, int backOffInitialInterval, int backOffMaxInterval, double backOffMultiplier, ILogger logger = null)
Parameters
retryableExceptions
Dictionary<Type, bool>maxAttempts
intdefaultRetryable
boolbackOffInitialInterval
intbackOffMaxInterval
intbackOffMultiplier
doublelogger
ILogger
PollyRetryTemplate(int, int, int, double, ILogger)
public PollyRetryTemplate(int maxAttempts, int backOffInitialInterval, int backOffMaxInterval, double backOffMultiplier, ILogger logger = null)
Parameters
maxAttempts
intbackOffInitialInterval
intbackOffMaxInterval
intbackOffMultiplier
doublelogger
ILogger
Methods
Execute(Action<IRetryContext>)
Execute the supplied RetryCallback with the configured retry semantics.
public override void Execute(Action<IRetryContext> retryCallback)
Parameters
retryCallback
Action<IRetryContext>the callback
Execute(Action<IRetryContext>, IRecoveryCallback)
Execute the supplied RetryCallback with the configured retry semantics. When retry is exhausted, call the recoverycallback
public override void Execute(Action<IRetryContext> retryCallback, IRecoveryCallback recoveryCallback)
Parameters
retryCallback
Action<IRetryContext>the callback
recoveryCallback
IRecoveryCallbackthe callback after retries are exhausted
Execute(Action<IRetryContext>, Action<IRetryContext>)
Execute the supplied RetryCallback with the configured retry semantics. When retry is exhausted, call the recoverycallback
public override void Execute(Action<IRetryContext> retryCallback, Action<IRetryContext> recoveryCallback)
Parameters
retryCallback
Action<IRetryContext>the callback
recoveryCallback
Action<IRetryContext>the callback after retries are exhausted
Execute<T>(Func<IRetryContext, T>)
Execute the supplied RetryCallback with the configured retry semantics.
public override T Execute<T>(Func<IRetryContext, T> retryCallback)
Parameters
retryCallback
Func<IRetryContext, T>the callback
Returns
- T
result of operation
Type Parameters
T
the type of return value
Execute<T>(Func<IRetryContext, T>, IRecoveryCallback<T>)
Execute the supplied RetryCallback with the configured retry semantics. When retry is exhausted, call the recoverycallback
public override T Execute<T>(Func<IRetryContext, T> retryCallback, IRecoveryCallback<T> recoveryCallback)
Parameters
retryCallback
Func<IRetryContext, T>the callback
recoveryCallback
IRecoveryCallback<T>the callback after retries are exhausted
Returns
- T
result of the operation
Type Parameters
T
the type of return value
Execute<T>(Func<IRetryContext, T>, Func<IRetryContext, T>)
Execute the supplied RetryCallback with the configured retry semantics. When retry is exhausted, call the recoverycallback
public override T Execute<T>(Func<IRetryContext, T> retryCallback, Func<IRetryContext, T> recoveryCallback)
Parameters
retryCallback
Func<IRetryContext, T>the callback
recoveryCallback
Func<IRetryContext, T>the callback after retries are exhausted
Returns
- T
result of the operation
Type Parameters
T
the type of return value