ASP. net mvc involves 5 synchronous and asynchronous (1)

Source: Internet
Author: User

The Action method has two basic forms: Synchronous execution and asynchronous execution. the entire system of NETMVC involves many synchronous/asynchronous execution methods. Although this has been introduced in the previous article, in order to give readers an overall understanding of this, let's make a summative discussion.

1. MvcHandler synchronization and Asynchronization

For ASP. net mvc applications, MvcHandler is the final HttpHandler used to process requests. It uses UrlRoutingModule, which enables the HTTP module of URL routing to be dynamically mapped to the corresponding request. MvcHandler activates and executes the target Controller with the help of ControllerFactory, and releases the activated Controller after the execution ends. For related content, see Chapter 1 "Controller activation" in this book ". As shown in the following code snippet, MvcHandler implements both the IHttpHandler and IHttpAsyncHandler interfaces, so it always calls the BeginProcessRequest/EndProcessRequest method to process requests asynchronously.

 
 
  1. Public class MvcHandler: IHttpAsyncHandler, IHttpHandler ,...
  2. {
  3. // Other members
  4. IAsyncResult IHttpAsyncHandler. BeginProcessRequest (HttpContext context, AsyncCallback cb, object extraData );
  5. Void IHttpAsyncHandler. EndProcessRequest (IAsyncResult result );
  6. Void IHttpHandler. ProcessRequest (HttpContext httpContext );
  7. }


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.