-
Notifications
You must be signed in to change notification settings - Fork 224
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
Document next retry delay in .NET #3085
base: main
Are you sure you want to change the base?
Conversation
@@ -125,6 +125,21 @@ return await Workflow.ExecuteActivityAsync( | |||
}); | |||
``` | |||
|
|||
### Overriding the retry interval with Next Retry Delay {#next-retry-delay} |
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.
### Overriding the retry interval with Next Retry Delay {#next-retry-delay} | |
### Override the Retry interval with `NextRetryDelay` {#next-retry-delay} |
- We use infinitive/base form, not present participle.
- When using specific code-derived terms, such as field names, use code face without spaces.
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.
This is the form already present/approved at docs/develop/java/failure-detection.mdx
and may be a rule worth applying consistently there too instead of just here (but feel free to apply here first)
@@ -125,6 +125,21 @@ return await Workflow.ExecuteActivityAsync( | |||
}); | |||
``` | |||
|
|||
### Overriding the retry interval with Next Retry Delay {#next-retry-delay} | |||
|
|||
You may throw an [Application Failure](/references/failures#application-failure) with the NextRetryDelay field set. This value will replace and override whatever the retry interval would be on the retry policy. |
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.
You may throw an [Application Failure](/references/failures#application-failure) with the NextRetryDelay field set. This value will replace and override whatever the retry interval would be on the retry policy. | |
When you throw an [Application Failure](/references/failures#application-failure) and assign the `NextRetryDelay` field, its value replaces and overrides the Retry interval defined in the active Retry Policy. |
- Retry and Retry Policy are reserved terms (see Vale list)
- Consider adding where it was thrown from, "When you throw...from an Activity, and assign the..."
- What is the active Retry Policy for? An Activity Handle/Stub that called this Activity? Consider adding "in the active Retry Policy for the...."
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.
This is the form already present/approved at docs/develop/java/failure-detection.mdx
and may be a rule worth applying consistently there too instead of just here (but feel free to apply here first)
|
||
You may throw an [Application Failure](/references/failures#application-failure) with the NextRetryDelay field set. This value will replace and override whatever the retry interval would be on the retry policy. | ||
|
||
For example, if in an activity, you want to base the interval on the number of attempts, you might do: |
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.
For example, if in an activity, you want to base the interval on the number of attempts, you might do: | |
For example, you might scale the next Retry delay interval based on the current number of attempts. | |
Here's how you'd do that in an Activity: |
- Activity is a reserved term, so capitalized
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.
This is the form already present/approved at docs/develop/java/failure-detection.mdx
and may be a rule worth applying consistently there too instead of just here (but feel free to apply here first)
For example, if in an activity, you want to base the interval on the number of attempts, you might do: | ||
|
||
```csharp | ||
var attempt = ActivityExecutionContext.Current.Info.Attempt; |
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.
It may be "obvious" by name and context that this is "retrieve attempt count from the Activity Execution context", but a comment wouldn't hurt, and ditto below, "Update the next Retry delay by assigning a Time value to the nextRetryDelay
field"
Also, this uses lower case n for Next. Is the material preceding incorrect?
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.
but a comment wouldn't hurt, and ditto below
This is the form already present/approved at docs/develop/java/failure-detection.mdx
and may be a rule worth applying consistently there too instead of just here (but feel free to apply here first)
Also, this uses lower case n for Next. Is the material preceding incorrect?
Yes
Note, this just copies content from already-approved/published Java and does the slightest alterations for .NET so as not to change what was already approved. Feel free to change what is needed there and here. We made this PR in a branch on the repo itself instead of in a fork so it could be edited by docs before merge. |
What does this PR do?
Adds the .NET next retry delay, which is the .NET equivalent of the Java version at #2940.