C# - How to use ForEachAsync()

With .Net 6 we get the new Parallel.ForEachAsync [https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.parallel.foreachasync?view=net-6.0] method from »

C# - Catching exceptions from unawaited tasks

I recently stumbled upon some code which looked something like the following: var ct = new CancellationToken(); Task.Run(async () => { while (!ct.IsCancellationRequested) { CallToMethodThatMightThrowAnException(); await Task.Delay( »