Guest User

Untitled

a guest
May 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. foreach(var item in collection)
  2. {
  3. DoWork().Wait;
  4. }
  5.  
  6. public async Task DoWork()
  7. {
  8. Try
  9. {
  10. Parallel.Invoke(
  11. () => Foo(),
  12. () => Foo2(),
  13. () => Foo3());
  14. }
  15. catch(Exception e)
  16. {
  17. //No exception caught
  18. }
  19. }
  20.  
  21. public void Foo()
  22. {
  23. Console.WriteLine("foo 1");
  24. }
Add Comment
Please, Sign In to add comment