Skip to content

Conversation

@SamRemis
Copy link
Contributor

@SamRemis SamRemis commented Nov 7, 2025

Summary

Introduces a resolver pattern for retry strategies that enables per-client caching and state management. This allows multiple operations from the same client to share a single retry strategy instance, which is important for strategies that maintain state across retries such as token buckets and rate limiters.

Motivation

Previously, each operation created its own retry strategy instance, preventing state sharing across operations from the same client. This change implements a resolver-based approach.

Key Changes

  • Added a new RetryStrategyResolver protocol similar to AuthSchemeResolver. This will be used for objects which will supply clients with retry strategies.
  • Added a CachingRetryStrategyResolver which implements the protocol and returns a unique instance of a requested retry strategy object per unique combination of max attempts setting and retry mode setting. This will get called by the client when no RetryStrategy is specified.
  • Added RetryStrategyOptions for users to configure their retry strategy mode and max attempts per client call.

@SamRemis SamRemis marked this pull request as ready for review November 11, 2025 14:22
@SamRemis SamRemis requested a review from a team as a code owner November 11, 2025 14:22
nateprewitt
nateprewitt previously approved these changes Nov 15, 2025
Copy link
Contributor

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what happened with the commits for the last change but once that's fixed this should be set.

nateprewitt
nateprewitt previously approved these changes Nov 17, 2025
@SamRemis SamRemis force-pushed the retry-mode-resolver branch from 36749b8 to a4c632b Compare November 19, 2025 03:17
- Add CachingRetryStrategyResolver for per-client retry strategy caching
- Add retry strategy configuration options
- Update client generation to support retry mode resolution
- Add comprehensive tests for retry functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants