Table of Contents

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 count times after the first attempt, so an operation runs at most count + 1 times. 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)

true retries every failure without end, false none.

implicit operator RetryRule(int)

As Times(int).