How to use Task.WhenAny and implement retry
问题 I have a solution that creates multiple I/O based tasks and I'm using Task.WhenAny() to manage these tasks. But often many of the tasks will fail due to network issue or request throttling etc. I can't seem to find a solution that enables me to successfully retry failed tasks when using a Task.WhenAny() approach. Here is what I'm doing: var tasks = new List<Task<MyType>>(); foreach(var item in someCollection) { task.Add(GetSomethingAsync()); } while (tasks.Count > 0) { var child = await Task