Skip to content

Conversation

@jhendrixMSFT
Copy link
Member

Added WithRetryOptions() that adds a custom RetryOptions to the provided
context, allowing custom settings per API call.
Remove 429 from the list of default HTTP status codes for retry.
Change StatusCodesForRetry to a slice so consumers can append to it.

Added WithRetryOptions() that adds a custom RetryOptions to the provided
context, allowing custom settings per API call.
Remove 429 from the list of default HTTP status codes for retry.
Change StatusCodesForRetry to a slice so consumers can append to it.
Copy link
Member

@catalinaperalta catalinaperalta left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@catalinaperalta catalinaperalta left a comment

Choose a reason for hiding this comment

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

Still lgtm!


// ContextWithRetryOptions adds the specified RetryOptions to the parent context.
// Use this to specify custom RetryOptions at the API-call level.
func ContextWithRetryOptions(parent context.Context, options RetryOptions) context.Context {
Copy link
Member

Choose a reason for hiding this comment

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

Rename to WithRetryOptions (no Context) to match WithValue, WithDeadline, etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

Originally I had it without the Context prefix however it seemed a big vague (i.e. azcore.WithRetryOptions()). Your examples are functions in the context package so you get names like context.WithValue() which is clear. I can remove the Context prefix if we think having the parent context being the first parameter is clear enough.

@jhendrixMSFT jhendrixMSFT merged commit 45732a6 into Azure:master Feb 18, 2020
@jhendrixMSFT jhendrixMSFT deleted the retryoptions branch February 18, 2020 19:16
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.

3 participants