Skip to content

Initial retries support #114

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Initial retries support #114

wants to merge 11 commits into from

Conversation

toptobes
Copy link
Collaborator

No description provided.

/* c8 ignore next: exceptional case */
: {};

clonedData = structuredClone(data);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this structured clone so that user-registered handlers don't accidentally modify data? If so, that's reasonable, just wondering.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That, and also so that it stays as the raw JSON response instead of running through the deserializer.

It's not a solution I'm very happy with though (structured clone isn't super performant and it isn't always even used here, and I plan to rectify it in a future release)

@@ -918,8 +920,14 @@ export class CommandFailedEvent extends CommandEvent {

// @public
export interface CommandOptions<Spec extends CommandOptionsSpec = Required<CommandOptionsSpec>> {
// (undocumented)
isSafelyRetryable?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you imagine users will set isSafelyRetryable on every command they want to be able to retry? Or will isSafelyRetryable be set on commands like findOne() that are read only by default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

isSafelyRetryable will be an option people can use to force-set a method as either idempotent or not; otherwise, each method will have its own default idempotency.

Btw retries are still a far-fetched idea in its early experimental stage, so I wouldn't pay them too much heed for the time being 🙂 there's a very rough brain-dump-like spec in our internal "yellow doc" which you should have access to if you want more information.

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