Innovenergy_trunk/csharp/lib/Utils/Try/Operators.sync.cs

15 lines
332 B
C#
Raw Normal View History

2023-02-16 12:57:06 +00:00
namespace InnovEnergy.Lib.Utils.Try;
public partial class TrySync<R>
{
public TrySync<R> Retry(Int32 nTimes)
{
return Retry<Exception>(nTimes);
}
public TrySync<R> Retry<E>(Int32 nTimes) where E:Exception
{
Boolean ShouldRetry(E _) => nTimes-- > 0;
return Retry<E>(ShouldRetry);
}
}