Beispiel #1
0
 private PolicyWrap _policyWrap(PatienceConfig patienceConfig) =>
 Policy.Wrap(_timeoutPolicy(patienceConfig.Timeout), _retryPolicy(patienceConfig.Interval));
Beispiel #2
0
 private AsyncPolicyWrap _policyWrapAsync(PatienceConfig patienceConfig) =>
 Policy.WrapAsync(_asyncTimeoutPolicy(patienceConfig.Timeout), _asyncRetryPolicy(patienceConfig.Interval));
        public static TResult Eventually <TResult>(Func <TResult> function, PatienceConfig patienceConfig = null)
        {
            var config = patienceConfig ?? DefaultPatienceConfig;

            return(new EventuallyClass(config).Eventually(function));
        }
Beispiel #4
0
 public EventuallyClass(PatienceConfig patienceConfig)
 {
     _patienceConfig = patienceConfig;
 }
        public static async Task EventuallyAsync(Func <Task> func, PatienceConfig patienceConfig = null)
        {
            var config = patienceConfig ?? DefaultPatienceConfig;

            await new EventuallyClass(config).EventuallyAsync(func);
        }
        public static async Task <TResult> EventuallyAsync <TResult>(Func <Task <TResult> > func, PatienceConfig patienceConfig = null)
        {
            var config = patienceConfig ?? DefaultPatienceConfig;

            return(await new EventuallyClass(config).EventuallyAsync(func));
        }
        public static void Eventually(Action function, PatienceConfig patienceConfig = null)
        {
            var config = patienceConfig ?? DefaultPatienceConfig;

            new EventuallyClass(config).Eventually(function);
        }
 public EventuallyTimeoutException(PatienceConfig patienceConfig)
     : base(DidNotEventuallySucceedWithTimeout(patienceConfig.Timeout))
 {
     Timeout  = patienceConfig.Timeout;
     Interval = patienceConfig.Interval;
 }
 public EventuallyTimeoutException(PatienceConfig patienceConfig, int attempts, Exception innerException)
     : base(DidNotEventuallySucceedWithError(patienceConfig.Timeout, attempts, innerException.Message), innerException)
 {
     Timeout  = patienceConfig.Timeout;
     Interval = patienceConfig.Interval;
 }