Open mu88 opened 2 years ago
Asuming the following code:
public void DoSomethingBig() { DoSomethingSmallAsync(); } public Task DoSomethingSmallAsync() { return Task.Delay(100); }
As you can see, DoSomethingSmallAsync() is not awaited within DoSomethingBig() which could lead to some problems.
DoSomethingSmallAsync()
DoSomethingBig()
That gets even more important if a team decides to avoid the regular Async method name suffix - you cannot spot it at a glance during code review.
Async
What do you think about checking for not awaited asynchronous method calls? Is that even possible?
I'm also happy to provide a PR if you could assist me with some advices how to approach.
@ristogod: any thoughts about that?
Asuming the following code:
As you can see,
DoSomethingSmallAsync()
is not awaited withinDoSomethingBig()
which could lead to some problems.That gets even more important if a team decides to avoid the regular
Async
method name suffix - you cannot spot it at a glance during code review.What do you think about checking for not awaited asynchronous method calls? Is that even possible?
I'm also happy to provide a PR if you could assist me with some advices how to approach.