什么时候应该使用异步控制器在asp.net mvc 2? [英] When should one use asynchronous controller in asp.net mvc 2?

查看:194
本文介绍了什么时候应该使用异步控制器在asp.net mvc 2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,使用 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绑定时才使用异步。一个很好的例子是聚合来自多个服务器的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/

对于更深入但不是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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆