Skip to content

Add a Polly resilience behavior #266

Description

@kzu

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.

Back this issue
Back this issue

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions