Final Project: Async Multi-Source Downloader
Combine everything from this course into a small but realistic async tool.
Requirements
- Write an async method that downloads or fetches data from at least 3 different sources (URLs, files, or simulated delays with
Task.Delay) concurrently, usingTask.WhenAll. - Support cancellation: accept a
CancellationToken, and let the user cancel the whole operation (e.g. by pressing a key while it's running). - Handle failures gracefully: if one source fails, log which one and continue reporting results for the others, instead of the whole program crashing.
- Add a timeout using
Task.WhenAnyracing the real operation againstTask.Delay(timeout), cancelling and reporting a timeout message if the delay wins. - Use an
IAsyncEnumerable<T>method to stream and print progress updates (e.g. "Source A: 50% done") as they happen, instead of only printing a final summary.
Stretch goals
- Add retry logic: if a source fails, retry it up to 2 more times with a short delay between attempts before giving up.
- Track and print total elapsed time, and compare it to what sequential (non-concurrent) execution would have taken.
- Wrap the whole thing in a small console menu so a user can re-run it with different sources without restarting the program.
Submit your repository link below when you are done, an instructor will review it before you can mark this lesson complete. Good luck! 🚀