Summary
Adapt a Polly ResiliencePipeline to IStuntBehavior. Retry, circuit breaker, timeout, rate limiter, fallback, hedging, and chaos stay in Polly.
API
A behavior constructed with ResiliencePipeline. It runs next through Polly's execute API.
For awaitable members, use Proceed so each Polly attempt awaits the Task or ValueTask and observes its fault. A synchronous exception and a faulted awaitable both count as a failed attempt.
Keep the Polly reference optional, in a companion package, so Stunts itself does not depend on Polly.
Constraints
- Use Polly's Native AOT surface. Do not reflect over
T to read a task result.
- Recommended order, outer to inner: observation, this resilience behavior, then inside each attempt the transaction and the cache, then the target.
Acceptance
- A retry strategy invokes the target again after a throw or a faulted task, then returns the successful value.
- A fallback strategy can supply a result without a further target call.
- The behavior adds no retry loop of its own.


Summary
Adapt a Polly
ResiliencePipelinetoIStuntBehavior. Retry, circuit breaker, timeout, rate limiter, fallback, hedging, and chaos stay in Polly.API
A behavior constructed with
ResiliencePipeline. It runsnextthrough Polly's execute API.For awaitable members, use
Proceedso each Polly attempt awaits theTaskorValueTaskand observes its fault. A synchronous exception and a faulted awaitable both count as a failed attempt.Keep the Polly reference optional, in a companion package, so
Stuntsitself does not depend on Polly.Constraints
Tto read a task result.Acceptance