public static RetryCondition On <TException>(Func <RetryConditionHandle, bool> predicate) where TException : Exception { var retry = new Retry(); return(OnInternal <TException>(retry, predicate)); }
public RetryCondition(Retry retry, Func <RetryConditionHandle, bool> predicate) { Retry = retry; Retry.Conditions.Add(this); FilterCondition = predicate; }
public static RetryCondition On <TException>() where TException : Exception { var retry = new Retry(); return(OnInternal <TException>(retry)); }
private static RetryCondition OnInternal <TException>(Retry retry, Func <RetryConditionHandle, bool> predicate) where TException : Exception { Func <RetryConditionHandle, bool> typeCheckingPredicate = (handle) => handle.Context.DidExceptionOnLastRun && handle.Context.LastException is TException && predicate(handle); return(new RetryCondition(retry, typeCheckingPredicate)); }
private static RetryCondition OnInternal <TException>(Retry retry) where TException : Exception { return(OnInternal <TException>(retry, (handle) => true)); }
public static RetryCondition On(Func <RetryConditionHandle, bool> predicate) { var retry = new Retry(); return(new RetryCondition(retry, predicate)); }
public RetryContext(Retry retry) { Retry = retry; ConditionHandles = retry.Conditions.Select(condition => new RetryConditionHandle(this, condition)).ToList(); }