How it works...

From the console window output, you can see that the minimum number of machines required to be online was not achieved. The application then threw an exception and caught it from the Parallel.ForEach loop. Being able to handle exceptions in parallel loops such as this one is essential for maintaining the stability of your application by being able to handle exceptions as they occur.

I encourage you to play around a little with the Parallel.ForEach loop and drill into some of the inner methods of the AggregareException class to really understand it better.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.114.19