Can I use an asynchronous controller here? (ASP.NET MVC 3)

I have this method [HttpPost]:

[HttpPost]
public ActionResult AddReview(Review review)
{
   repository.Add(review);
   repository.Save();
   repository.UpdateSystemScoring(review.Id); // call SPROC with new Review ID.
   return View("Success", review);
}

So, basically the user clicks the button, I add it to my database (through Entity Framework 4.0), save the changes, and then call the stored procedure with the identification field, which is the second second line of code.

This must be done after saving the overview (since the identifier field is created only after calling Save, and EF saves the changes), and this is a system-wide calculation.

From the user's point of view, he / she does not want / should not worry that this calculation is taking place.

This procedure can take from 0 to 20 seconds. It does not return anything.

Is this a candidate for an asynchronous controller?

SPROC, ""?

( ): , (ASP.NET Web Forms) , - , ASP.NET MVC 3.

ASP.NET, №1, , .

- ? . , , , .

+5
4

( ) , . , , - , , . . , SQL Server BeginRead ADO.NET. , . , .

+4

, SQL Server Windows, x . , , .

30 .

, , , asyc , .

+1

, , , , /. ajax, , , .

, , . ASP.net, , , , , - , , , async.

+1

, . , , .

Action -> causes javascript request to web server
   |
Web server puts notification on queue
   |
Worker picks up message from queue and does point calculation
   |
At some point in future user sees points adjusted

This allows us to handle large volumes of user load and not worry about it, having a negative impact on our computing mechanism. It also means that we can add more workers to handle a larger load when we have a large load, and we can remove workers when we do not have a large load.

+1
source

All Articles