当你应该使用ASP.NET MVC异步控制器? [英] When should you use Async Controllers in ASP.NET MVC?

查看:136
本文介绍了当你应该使用ASP.NET MVC异步控制器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更改一个ASP.NET MVC同步控制器(控制器)以异步控制器( AsyncController )似乎是一个琐碎的事情,但你应该何时做?

Changing an ASP.NET MVC synchronous controller (Controller) to an asynchronous controller (AsyncController) seems like a trivial thing to do, but when should you do it?

我是不是应该让每个控制器的异步不论其行动?什么是如果异步控制器中使用,将提高操作的例子吗?

Should I just make every controller async irrespective of its actions? What are examples of operations that would be improved if used in an asynchronous controller?

以最简单的例子:静态的HTML页面。所以,你有最基础的控制器,它简单地返回查看首页的行动。如果这种控制器更改为异步,即从现在 IndexCompleted

Taking the most trivial example: static html pages. So you have the most basic of controllers which simply returns a View from the Index action. Should this controller be changed to asynchronous i.e. now returning from IndexCompleted?

推荐答案

我在读这<一个href=\"http://blog.stevensanderson.com/2010/01/25/measuring-the-performance-of-asynchronous-controllers/\">article最近。它认为它总结了AsyncController是换货的。

I was reading this article recently. It think it summarizes what AsyncController are ment for.

这篇关于当你应该使用ASP.NET MVC异步控制器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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