For more content like this, follow ButterCMS on Twitter and subscribe to our blog.
Networks are unreliable. At some point we’ve all experienced ...
For further actions, you may consider blocking this person and/or reporting abuse
LINQ uses lazy evaluation so
uniqueExceptions
in the last example will be enumerated and processed for distinct elements 3 times - for the.Count()
,.First()
and the final return. You should just call.ToList()
after.Distinct()
to get an actualList
of exceptions.There's also the Polly library which handles retries, timeouts, circuit breakers and many other resiliency situations in a well built API.
github.com/App-vNext/Polly
Nice article. I've been looking at some of the concepts in Netflix's OSS client library hystrix github.com/Netflix/Hystrix for my api clients. It's got other useful functions like circuit breakers and incremental backoff on retries. There's even a c# port of it. github.com/Elders/Hystrix.NET