Struct RetryRule
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
TanStack's retry option as a value: a number of retries, every failure, no failure, or a function
of the failure. A number or a bool converts implicitly, and When(Func<int, Exception, bool>) takes the function.
public readonly struct RetryRule
Remarks
The default value retries nothing.
Methods
- Times(int)
Retries up to
counttimes after the first attempt, so an operation runs at mostcount + 1times. Zero or less makes no retry.
- When(Func<int, Exception, bool>)
Decides from the number of failures before this one and this failure's exception whether to retry. The function replaces a count rather than narrowing one, so it alone ends the retries: one that always accepts retries without end.
Operators
- implicit operator RetryRule(bool)
trueretries every failure without end,falsenone.