TimeoutStrategyOptions
Represents the options for the timeout strategy.
using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace Polly.Timeout
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
public class TimeoutStrategyOptions : ResilienceStrategyOptions
{
public sealed override string StrategyType => "Timeout";
[Range(typeof(TimeSpan), "00:00:01", "1.00:00:00")]
public TimeSpan Timeout { get; set; } = TimeSpan.FromSeconds(30);
[System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0
})]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0
})]
public Func<TimeoutGeneratorArguments, ValueTask<TimeSpan>> TimeoutGenerator {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0
})]
set;
}
[System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
public Func<OnTimeoutArguments, ValueTask> OnTimeout {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})]
set;
}
}
}