Class TimeoutStrategyOptions
Represents the options for the timeout strategy.
public class TimeoutStrategyOptions : ResilienceStrategyOptions
- Inheritance
-
TimeoutStrategyOptions
- Inherited Members
Constructors
TimeoutStrategyOptions()
Initializes a new instance of the TimeoutStrategyOptions class.
public TimeoutStrategyOptions()
Properties
OnTimeout
Gets or sets the timeout delegate that raised when timeout occurs.
public Func<OnTimeoutArguments, ValueTask>? OnTimeout { get; set; }
Property Value
- Func<OnTimeoutArguments, ValueTask>
The default value is null.
Timeout
Gets or sets the default timeout.
[Range(typeof(TimeSpan), "00:00:00.010", "1.00:00:00")]
public TimeSpan Timeout { get; set; }
Property Value
- TimeSpan
This value must be greater than 10 milliseconds and less than 24 hours. The default value is 30 seconds.
TimeoutGenerator
Gets or sets a timeout generator that generates the timeout for a given execution.
public Func<TimeoutGeneratorArguments, ValueTask<TimeSpan>>? TimeoutGenerator { get; set; }
Property Value
- Func<TimeoutGeneratorArguments, ValueTask<TimeSpan>>
The default value is null.
Remarks
When generator is null then the Timeout property's value is used instead. When generator returns a TimeSpan value that is less than or equal to Zero then the strategy will do nothing.
Return InfiniteTimeSpan to disable the timeout for the given execution.