RetryPolicyExtensions Class
- Namespace
- Kampute.Resilience
- Assembly
- Kampute.Resilience.dll
Definition
Provides extension methods for retry policies whose configuration depends on the result type.
public static class RetryPolicyExtensions- Inheritance
- object
- RetryPolicyExtensions
Methods
DisposeDiscarded<T>(this RetryPolicy<T>)
Creates a policy that disposes each result that execution does not return.
public static RetryPolicy<T> DisposeDiscarded<T>(this RetryPolicy<T> policy)
where T : IDisposableType Parameters
T- The disposable type returned by the operations the policy runs.
Parameters
policyRetryPolicy<T>- The policy to extend.
Returns
- RetryPolicy<T>
- A new policy that invokes the discard handlers of
policyand then disposes the discarded result.
Exceptions
- ArgumentNullException
- Thrown if
policyisnull.

nullresult is skipped. The result that execution returns is not disposed; it remains the caller's. See RetryPolicy<T>.OnDiscarded(Action<T>) for when a result is discarded.