private void _eventQueue_ReceiveCompleted(object sender, ReceiveCompletedEventArgs e)
 {
     if (!IsExiting())
     {
         if (e.Message?.Body != null && e.Message.Body is RFWorkQueueItem)
         {
             var wki = e.Message.Body as RFWorkQueueItem;
             if (wki.Item is RFEvent)
             {
                 var evt = wki.Item as RFEvent;
                 Log.Debug(this, "Received event {0} from MSMQ", evt);
                 _eventSink.RaiseEvent(this, evt, wki.ProcessingKey);
             }
             else if (wki.Item is RFInstruction)
             {
                 var ins = wki.Item as RFInstruction;
                 Log.Debug(this, "Received instruction {0} from MSMQ", ins);
                 _instructionSink.QueueInstruction(this, ins, wki.ProcessingKey);
             }
             else
             {
                 Log.Warning(this, "Unknown item type on MSMQ event queue: {0}", wki.Item.GetType().FullName);
             }
         }
         _eventQueue.BeginReceive();
     }
 }
Пример #2
0
 public void QueueInstruction(object raisedBy, RFInstruction instruction)
 {
     _instructions.QueueInstruction(raisedBy, instruction, ProcessingKey);
 }