问题描述
到目前为止,使用 asp.net mvc1
并且刚开始使用 asp.net mvc2
..... 异步执行控制器的最佳候选者是什么?我应该将它用于长时间运行的进程还是一些后台处理?在 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...
推荐答案
仅当操作是 IO 绑定时才使用 async.一个很好的例子是聚合来自多个服务器的 RSS 提要,然后将它们显示在网页中.
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.
见:
- 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.
关于更深入但非 MVC 的特定信息:http://blogs.msdn.com/tmarq/archive/2010/04/14/performing-asynchronous-work-or-tasks-in-asp-net-applications.aspx
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
这篇关于什么时候应该在 asp.net mvc 2 中使用异步控制器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!