Quantcast
Channel: Active questions tagged retry-logic - Stack Overflow
Viewing all articles
Browse latest Browse all 950

How do I use the new resilience strategy in polly.core to a fallback strategy with custom action?

$
0
0

I have an older policy that fallsback to a custom action.

// Several other overloads including one that's synchronous and has `void` as a return type. // Required as some of our older services have not been asyncified yetpublic void RetryWithPolicy(Action action) {     var policy = Policy.Handle<BrokenCircuitException>()                                 .Fallback(_ => action())                                 .Wrap(someCircuitBreakerPolicy)                                 .Wrap(someWaitAndRetryPolicy);    policy.Execute(action);}

I'm unable to find a way to do this using the new resilience strategy properly? Is the correct way to add a hedging strategy that allows the callback to be re-executed? Looking at the fallback strategy, I wasn't able to find a way to execute the callback?


Viewing all articles
Browse latest Browse all 950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>