一、Orchard里异步请求处理线程队列的控制

Orchard的Orchard.WarmupStarter模块,为HttpApplication.BeginRequest时间附加了一个异步处理事件:BeginBeginRequest。

/// <summary>
/// 启动 System.Web.HttpApplication.BeginRequest 的异步处理的 System.Web.BeginEventHandler
/// System.Web.HttpApplication.BeginRequest 在 ASP.NET 响应请求时作为 HTTP 执行管线链中的第一个事件发生。 
/// </summary>
object extradata)
   6: {
// host is available, process every requests, or file is processed
if (!InWarmup() || WarmupUtility.DoBeginRequest(_context))
   9:     {
/***
         *  !InWarmup()  不在预热中
         *  WarmupUtility.DoBeginRequest(_context) 找到了与请求URL匹配的静态文件资源
         */
new DoneAsyncResult(extradata);
  15:         cb(asyncResult);
return asyncResult;
  17:     }
else
  19:     {
new WarmupAsyncResult(cb, extradata);
  22:         Await(asyncResult.Completed);
return asyncResult;
  24:     }
  25: }

相关文章:

  • 2022-12-23
  • 2021-07-23
  • 2022-02-23
  • 2021-07-01
  • 2022-01-24
  • 2022-12-23
  • 2021-10-06
  • 2021-12-25
猜你喜欢
  • 2021-11-04
  • 2022-12-23
  • 2021-07-13
  • 2021-11-22
  • 2021-08-14
相关资源
相似解决方案