コード例 #1
0
 private void ProcessTask(BackgroundTask task)
 {
     HandleTask(task, handler =>
     {
         using (EntryPointContext.SetEntryPoint("BackgroundTask"))
         {
             ProcessMonitorWriter.Instance.Write("BackgroundTask");
             using (DeferredChannelMessageContext deferredMsgContext = new DeferredChannelMessageContext())
             {
                 var contextData = task.Context;
                 using (CustomContext.SetContext(contextData))
                 {
                     handler.HandleTask(task);
                 }
             }
         }
     });
 }
コード例 #2
0
 /// <summary>
 /// Run the provided task in the current thread immediately
 /// </summary>
 /// <param name="task">The task to run</param>
 public void ExecuteImmediately(BackgroundTask task)
 {
     ProcessTask(task);
 }
コード例 #3
0
 public void EnqueueTask(BackgroundTask task)
 {
     EnqueueTask(RequestContext.TenantId, task);
 }