コード例 #1
0
        void Execute(IList <T> data, int start, int count, BinaryRetryResult <T> results)
        {
            if (count == 0)
            {
                return;
            }

            results.Executes++;
            try
            {
                Action(data, start, count);
                return;
            }
            catch
            {
                if (count == 1)
                {
                    results.FailedRecords.Add(data[start]);
                    return;
                }
            }

            foreach (var part in Partitioner.ByCount(count, RetryPartitions))
            {
                Execute(data, start + part.Start, part.Count, results);
            }
        }
コード例 #2
0
        public BinaryRetryResult <T> Execute(IList <T> data)
        {
            var results = new BinaryRetryResult <T>();

            foreach (var slice in Partitioner.ByMaxSize(data.Count, SliceSize))
            {
                try
                {
                    Execute(data, slice.Start, slice.Count, results);
                }
                catch
                {
                    // Ignore
                }
            }

            return(results);
        }