Does an asynchronous task need to be completed without returning before an ASP.NET request can complete

I am developing an auction trading system for commercial vehicles within the company in which I work.

Traders can set alerts and whenever a new announcement is sent, I want to use the details of the new listing to search all match alerts, but this should not be the time when a trader needs to wait for confirmation of his successful announcement, so I want to run it in background mode.

My question is: if I tag the async function and not worry about returning, does the ASP.NET MVC Framework still want to wait for the asynchronous function to complete before the request ends?

I know that I can probably verify this, but I'm not sure how, I'm not too deep in my asynchronous books.

Thanks.

+7
c # asynchronous asp.net-mvc
source share
1 answer

In ASP.NET, you are limited by the boundaries of the specified HTTP request / response. You can and should use async/await inside your ASP.NET MVC / Web API management methods (as described here ), this improves the scalability of your web application.

However, this does not alter the fact that the client web browser has sent an HTTP request and is still waiting for an HTTP response. Typically, all async operations started by the asynchronous call controller method must be completed before a response is sent to the client.

If you need to do long-term server-side work across the boundaries of a single HTTP request, here is the answer. If your client logic requires high-frequency updates from the server, Microsoft has SignalR for this.

+3
source share

All Articles