How to - Multiple Async tasks with timeout and cancellation
问题 I would like to fire several tasks while setting a timeout on them. The idea is to gather the results from the tasks that beat the clock, and cancel (or even just ignore) the other tasks. I tried using extension methods WithCancellation as explained here, however throwing an exception caused WhenAll to return and supply no results. Here's what I tried, but I'm opened to other directions as well (note however that I need to use await rather than Task.Run since I need the httpContext in the