TimeoutPolicy<TResult>
public class TimeoutPolicy<TResult> : Policy<TResult>, ITimeoutPolicy<TResult>, ITimeoutPolicy, IsPolicy
A timeout policy which can be applied to delegates returning a value of type TResult.
using Polly.Utilities;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Polly.Timeout
{
public class TimeoutPolicy<TResult> : Policy<TResult>, ITimeoutPolicy<TResult>, ITimeoutPolicy, IsPolicy
{
internal TimeoutPolicy(Func<Func<Context, CancellationToken, TResult>, Context, CancellationToken, TResult> executionPolicy)
: base(executionPolicy, PredicateHelper.EmptyExceptionPredicates, PredicateHelper<TResult>.EmptyResultPredicates)
{
}
internal TimeoutPolicy(Func<Func<Context, CancellationToken, Task<TResult>>, Context, CancellationToken, bool, Task<TResult>> asyncExecutionPolicy)
: base(asyncExecutionPolicy, Enumerable.Empty<ExceptionPredicate>(), Enumerable.Empty<ResultPredicate<TResult>>())
{
}
}
}