Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should one use asynchronous controller in asp.net mvc 2?

Thus far worked with asp.net mvc1 and just started with asp.net mvc2..... what are good candidates for executing a controller asynchronously? Should i use it for long running process or some background processing? What are the pros and cons choosing asynchronous controller in asp.net mvc 2? Any suggestion...

like image 379
ACP Avatar asked May 13 '10 10:05

ACP


1 Answers

Only use async if the operation is IO bound. A good example would be aggregating RSS feeds from multiple servers and then displaying them in a webpage.

See:

  • http://msdn.microsoft.com/en-us/magazine/ee336138.aspx
  • http://blog.stevensanderson.com/2008/04/05/improve-scalability-in-aspnet-mvc-using-asynchronous-requests/

for a good overview of asynchronous controllers.

And for more in-depth but non-MVC specific info: http://blogs.msdn.com/tmarq/archive/2010/04/14/performing-asynchronous-work-or-tasks-in-asp-net-applications.aspx

like image 98
LondonBasedEngineer Avatar answered Oct 04 '22 10:10

LondonBasedEngineer