At which point and time does the MvcApplication call the HttpAplications events like:
...
public event EventHandler PreSendRequestHeaders;
public event EventHandler PostResolveRequestCache;
public event EventHandler PreSendRequestContent;
public event EventHandler PostMapRequestHandler;
public event EventHandler PostLogRequest;
public event EventHandler RequestCompleted;
...
How does it know when the previous Handler (of the previous event) has finished?Are the Handlers called synchronously to be ready one after another? Here one example:
// gets called through HttpApplication.BeginRequest event
protected void Application_BeginRequest() {
Thread.Sleep(60000);
// Waits very long
Debug.WriteLine("begin");
}
// gets invoked after BeginRequest by the Event AuthenticateRequest
// Event is used to attach Authentication related operations to it
protected void Application_AuthenticateRequest() {
Debug.WriteLine("authentication in process");
}
// Output:
// begin
// authentication in process
Normally the excution of event handlers which are called one after another, would overlap. These do not. Why?