I have an Index
action in ASP.net MVC controller. This action, calls (among other things) a private action that do a count on a SQL table with large set of rows. Th
This works. But is this really async?
It is async in the fact that once you query your database (which is an IO bound operation), you free the ASP.NET Thread-Pool thread instead of using it to block until the query finishes.
Async doesn't mean "Return this request to the caller, and i'll finish executing at a later time", which is somewhat what you're expecting. It doesn't break the HTTP request-response protocol. What you want isn't achieved by async.
If you want the request to complete immediately, you'll need to queue it on some background thread, and push the data to the client side once the operation is complete.