Should Polly Policies be singletons?
问题 I have a query, IGetHamburgers , that calls an external API. I've registered the implementation of IGetHamburgers in my DI container as a Singleton. Im using Polly as a Circuitbreaker, if two requests fails the circuit will open. My goal is that all calls to the Hamburger api should go through the same circuitbreaker, if GetHamburgers fails, then all other calls should fail as well. How should I use my Policy? Should I register my Policy as a field like this: private Policy _policy; private