Table of Contents

Class PollyRetryTemplate

Namespace
Steeltoe.Common.Retry
Assembly
Steeltoe.Common.RetryPolly.dll
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 int
defaultRetryable bool
backOffInitialInterval int
backOffMaxInterval int
backOffMultiplier double
logger ILogger

PollyRetryTemplate(int, int, int, double, ILogger)

public PollyRetryTemplate(int maxAttempts, int backOffInitialInterval, int backOffMaxInterval, double backOffMultiplier, ILogger logger = null)

Parameters

maxAttempts int
backOffInitialInterval int
backOffMaxInterval int
backOffMultiplier double
logger 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 IRecoveryCallback

the 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