[up-for-grabs] FEATURE: Add Noop policy
See original GitHub issueA NoopPolicy
would not influence execution of the delegate/func passed to Execute()
(etc) in any way: it would simply execute it.
Uses/benefits:
- For a feature-toggle to temporarily suspend use of the normal Polly policies (such as suggested in #182)
- Sometimes, in a unit-test, you may want to test the functionality of some SUT without a Polly Policy it contains coming into play. Passing the policy into the SUT by DI can facilitate this: passing in a
NoopPolicy
particularly.
(Current workround: passing in Retry(0)
achieves no-op, but this is not widely documented and not as immediately intuitive as NoopPolicy
might be.)
(great up-for-grabs item for anyone interested in getting familiar with the Polly codebase: state interest here and I can provide further pointers if helpful!)
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Polly
Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, ...
Read more >https://raw.githubusercontent.com/dotnet/samples/m...
70 area-Meta Hello, World! sample "Feature request: please add ""Hello, World!"" sample, which shows how to use .NET Core with user applications.
Read more >Polly Roadmap - App-vNext/Polly GitHub Wiki
The roadmap indicates currently envisaged or candidate development directions for Polly. Community feedback on features you would like, ...
Read more >Gsg Firefly Upgrade Parts
21 Add to Cart Eligible for FREE shipping * Hammer, Used Factory ... The GSG FireFly features a wear-resistant alloy frame outfitted ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can’t see a shorter way of getting to
Retry(0)
😉My thought on this had been that we go the step further and create the
NoOpPolicy
type. Semantically richer than retry-masking-noop, for probably <100 sloc.Also, a
NoOpPolicy
doesn’t need a.Handle<>()
clause (/doesn’t make sense), so we’d probably (like TimeoutPolicy) want to configure by static method directly onPolicy
.This one ‘up-for-grabs’ again, for anyone who wants to get into the Polly codebase!
(I heard on other channels that the original contrib is unavailable at mo)
Closed through #214