Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



ASYNCHRONOUS CONTROLLERS One of the major changes in ASP.NET MVC 4 involves asynchronous controllers. ASP.NET MVC 3 uses an AsyncController class that needs to be implemented to have asynchronous control- lers. ASP.NET MVC 4 brings the concept of asynchronous controllers into the default control- ler class. Asynchronous action methods are useful for long-running, non-CPU-bound requests because they avoid blocking the web server from performing work while the method request is still pending. When designing your action methods, you need to determine whether to use synchronous or asynchronous processing. You should strongly consider asynchronous methods when the operation is network-bound or I/O-bound rather than CPU-bound. Also, asynchronous methods make sense when you want to enable the user to cancel a long- running method. Modern computers have processors that have multiple cores, which makes multithreading even more important because it is gaining more support with every computer generation. Being able to do work on multiple threads allows parallel processing, which should result in an increase in performance, especially when multiple long-running processes occur during the same HTTP request. When designing your ASP.NET MVC 4 application, you should look at every process that reaches outside of your domain and consider making them asynchronous. You should do the same for those calls that might be long-running, such as pages that return lists from multiple data sources or that perform intensive business operations, because they could be ideal candidates for the using of asynchronous behavior. Using asynchronous actions is easy with ASP.NET MVC 4. The key to using the new asyn- chronous framework is the Task framework in the System.Threading.Tasks namespace. The purpose of Task is to provide a pluggable architecture to increase flexibility and to make mul- titasking applications easier to write. To create an asynchronous action on a controller, mark the controller as async and change the return from an ActionResult into a Task. In the C# code in Listing 1-1, the application is making a call to an external data feed
If you want to change selection, open document below and click on "Move attachment"

pdf

owner: ChrisMoses - (no access) - Exam Ref 70-486- Developing ASP.NET MVC 4 Web Applications.pdf, p29


Summary

statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

Details



Discussion

Do you want to join discussion? Click here to log in or create user.