question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[up-for-grabs] FEATURE: Add Noop policy

See original GitHub issue

A 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:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
reisenbergercommented, Jan 13, 2017

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 on Policy.

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)

0reactions
reisenbergercommented, Feb 4, 2017

Closed through #214

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found