Task-based async best practice
Posted: Mon Jul 02, 2018 4:17 pm
Hi Dick,
The code in the Infoworld article is actually a bit different... in that case Task.Run() is being awaited, which is why the method is also marked as "async". The code I'm proposing does not await the Task.Run call, which is the whole point as the idea is to short-circuit the need to keep propagating the async calls up through the method hierarchy.
It is definitely confusing though! I still haven't reached a definitive answer.
Nick
The code in the Infoworld article is actually a bit different... in that case Task.Run() is being awaited, which is why the method is also marked as "async". The code I'm proposing does not await the Task.Run call, which is the whole point as the idea is to short-circuit the need to keep propagating the async calls up through the method hierarchy.
It is definitely confusing though! I still haven't reached a definitive answer.
Nick