Table of Contents

Class TimeoutStrategyOptions

Namespace
Polly.Timeout
Assembly
Polly.Core.dll

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

If generator returns a TimeSpan value that is less or equal to Zero its value is ignored and Timeout is used instead. When generator is null the Timeout is used.

Return InfiniteTimeSpan to disable the timeout for the given execution.