Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(utl-retry): add util-retry package and its types #4224

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

srchase
Copy link
Contributor

@srchase srchase commented Nov 23, 2022

Issue

This PR adds the util-retry package, which adds StandardRetryStrategy and AdaptiveRetryStrategy.

These changes were broken out of the draft PR #4187.

middleware-retry will be updated in another PR to use these new retry strategies.

Description

What does this implement/fix? Explain your changes.

Testing

How was this change tested?

Additional context

Add any other context about the PR here.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@srchase srchase requested a review from a team as a code owner November 23, 2022 21:35
/**
*
*/
retrieveRetryTokens(errorInfo: RetryErrorInfo): number;
Copy link
Contributor

Choose a reason for hiding this comment

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

how does a number represent retryTokens? is it the count?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's the count of the available tokens. The default initial token count is set in constants.ts in util-retry.

Copy link
Contributor

Choose a reason for hiding this comment

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

is there room to rename this to e.g. getRetryTokenCount or similar? Some interfaces are called Token and this method name sounds like you are retrieving objects of that type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this can be renamed. Updated this to getRetryTokenCount in the latest.

packages/types/src/retry.ts Outdated Show resolved Hide resolved
packages/util-retry/package.json Outdated Show resolved Hide resolved
packages/util-retry/src/DefaultRateLimiter.ts Show resolved Hide resolved
packages/util-retry/src/types.ts Show resolved Hide resolved
packages/util-retry/src/types.ts Show resolved Hide resolved
packages/util-retry/src/StandardRetryStrategy.ts Outdated Show resolved Hide resolved
packages/util-retry/src/DefaultRateLimiter.ts Show resolved Hide resolved
packages/util-retry/src/DefaultRateLimiter.ts Show resolved Hide resolved
packages/types/src/retry.ts Outdated Show resolved Hide resolved
@srchase srchase force-pushed the add-util-retry branch 3 times, most recently from 4416270 to 2b0e056 Compare December 1, 2022 17:17
Author:    Chase Coalwell <782571+srchase@users.noreply.github.com>
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants