Example #1
0
 protected void SendLocalAsyncMessage(ProcessMessage pm)
 {
     System.Threading.Tasks.Task.Factory.StartNew((q) =>
     {
         ProcessMessage m = q as ProcessMessage;
         try
         {
             log.Warn("Handling async message {0} from {1}", m.GetType().Name, m.FromTaskInstanceId);
             HandleLocalAsyncMessage(pm);
         }
         catch (Exception ex)
         {
             //TODO: some error handling here, for example report 'TaskFailed' for EnableTask
             log.Error("Error handling local async message {0} from {1}: {2}", m.GetType().Name, m.FromTaskInstanceId);
         }
     }, pm);
 }