Skip to content

[Feature request]: Add AttemptNumber property to HedgingPredicateArguments used in ShouldHandle Func #2602

@renatogbp

Description

@renatogbp

Is your feature request related to a specific problem? Or an existing feature?

I am trying to dynamically control the number of MaxHedgedAttempts options. For example, by default the MaxHedgedAttempts would be respected, however certain flows could require a lower MaxHedgedAttempts value.

Describe the solution you'd like

Having the attemptNumber property inside Func<HedgingPredicateArguments<TResult>, ValueTask<bool>> ShouldHandle predicate would help us to make the decision to skip remaining hedge attempts based on the AttemptNumber.

As a workaround I am setting the Context from OnHedging predicate with the current attempt number. Then we can retrieve the context from ShouldHandle predicate.

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions