Пример #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);
 }