I have following request pipeline
Here,
A - Is a user who is accessing a MVC web application and clicks a button
B - Is a MVC controller (without any async/await) and makes a call to a GetDataAsync method of a rest api(C)
C - Is a rest api with async method named GetDataAsync
D - Is a database method call using entity framework and database calling method is async type.
With reference to the explanation on this link - https://learn.microsoft.com/en-us/archive/msdn-magazine/2014/october/async-programming-introduction-to-async-await-on-asp-net, when the threads are moved back to ThreadPool when the call is made for any I/O based operation, my questions are
- Is it the call at the point D in above pipeline which is resulting in thread being returned to the ThreadPool?
- If yes, it means the scalability of the rest-api is increased by making an async call to a I/O based operation, which in this case is database call i.e. D ?
- When the MVC controller makes an async call at point B, it is NOT contributing to scalability/performance of rest api, even if it is calling the async method of the api?