示例#1
0
        internal IContinuation DetermineContinuation(Exception exception, int attempts)
        {
            var handler = Policies.Concat(BaselinePolicies).FirstOrDefault(x => x.Matches(exception));

            if (handler == null)
            {
                return(new StopProjection());
            }
            // attempts are zero based in this case
            return(handler.Continuations.Count > attempts
                ? handler.Continuations[attempts]
                : new StopProjection());
        }
示例#2
0
        internal IContinuation DetermineContinuation(Exception exception, int attempts)
        {
            var policies = Policies.Concat(BaselinePolicies);

            foreach (var policy in policies)
            {
                if (policy.TryMatch(exception, attempts, out var continuation))
                {
                    return(continuation);
                }
            }

            return(new StopShard());
        }