Skip to content

Add possibility to remove the RetryPolicy from the workflow context without overriding the other existing ActivityOptions in it #1417

Open
@kittinanasi

Description

@kittinanasi

Is your feature request related to a problem? Please describe.
I set the ActivityOptions including a non-nil RetryOptions configuration at the beginning of my workflow, these ActivityOptions are used by all activities in my workflow by default. I would like to override the RetryPolicy to nil for just one activity in that workflow without overriding the other ActivityOptions configurations.

Proposed Solution
If the existing WithRetryPolicy() function syntaxes were changed to accept a pointer receiver RetryPolicy as a parameter, than that function could be called with a nil parameter value to solve the above problem.

Current syntax:

func WithRetryPolicy(ctx Context, retryPolicy RetryPolicy) Context {
	return internal.WithRetryPolicy(ctx, retryPolicy)
}

Suggested syntax:

func WithRetryPolicy(ctx Context, retryPolicy *RetryPolicy) Context {
	return internal.WithRetryPolicy(ctx, retryPolicy)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions