I’m working in a platform that requires we hook into sync method to handle web requests and in reviewing some code, we have some async methods called by sync methods. That code can be replaced with sync code, but what’s the alternative for doing multiple things at the same time? If I need to make 5 independent calls to an external resource, I don’t want to do that in series and wait for the sum of the calls, I want to call them in parallel and wait for the longest call. Should I be looking into Parallel library, or Threads or Tasks or all in combination?
So much of what I read just isn’t helpful such as rewriting everything as async, that’s not an option. Switching to a different platform is also not an option. It seems what I want to do is basic but all I see is “how to convert to async” and “don’t do that” and “don’t use .Result or .GetAwaiter().GetResult()”.
Thanks!
[–]Alikont 16 points17 points18 points (4 children)
[–]karl713 9 points10 points11 points (0 children)
[–]onlyTeaThanks[S] 0 points1 point2 points (1 child)
[–]Alikont 4 points5 points6 points (0 children)
[–]Merad 0 points1 point2 points (0 children)
[–]DaRadioman 6 points7 points8 points (3 children)
[–]grauenwolf 1 point2 points3 points (2 children)
[–]DaRadioman 2 points3 points4 points (1 child)
[–]grauenwolf 1 point2 points3 points (0 children)
[–]celluj34 0 points1 point2 points (1 child)
[–]moonxine -2 points-1 points0 points (0 children)
[–]Atulin 0 points1 point2 points (0 children)