-
Notifications
You must be signed in to change notification settings - Fork 8
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
base: master
Are you sure you want to change the base?
Conversation
/* c8 ignore next: exceptional case */ | ||
: {}; | ||
|
||
clonedData = structuredClone(data); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
No description provided.