[go: up one dir, main page]

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: rework low level message stream retries, add debugging #1713

Merged
merged 6 commits into from
Apr 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
feat: rework how subscriber streams are retried and generally managed
  • Loading branch information
feywind committed Apr 15, 2023
commit c75a7cb0eb1f8da7a8c4bf36050cdf71ccbc8a70
11 changes: 11 additions & 0 deletions src/exponential-retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ export class ExponentialRetry<T> {
this.scheduleRetry();
}

/**
* Resets an item that was previously retried. This is useful if you have
* persistent items that just need to be retried occasionally.
*
* @private
*/
reset(item: T) {
const retried = item as RetriedItem<T>;
delete retried.retryInfo;
}

// Takes a time delta and adds fuzz.
private randomizeDelta(durationMs: number): number {
// The fuzz distance should never exceed one second, but in the
Expand Down