protected override IEnumerable <TOutputMsg> DecorateOutputMessages(IEnumerable <TOutputMsg> outputMsgs) { if (outputMsgs == null) { yield break; } var e = outputMsgs.GetEnumerator(); while (true) { if (!e.MoveNext()) { yield break; } TOutputMsg outputMsg = e.Current; if (outputMsg.IsBroken) { Interlocked.Increment(ref m_NumBrokenMsgs); LogAgent.LogBrokenMessage(DataflowNetworkConstituent.Transformation, Name, outputMsg.Title, outputMsg); } else { LogAgent.LogTrace(DataflowNetworkConstituent.Transformation, Name, "Transformed: old: {0} new: {1}", outputMsg.Title, outputMsg.Title); } yield return(outputMsg); } }
protected override IEnumerable <TInputMsg> DecorateInputMessages(IEnumerable <TInputMsg> inputMsgs) { var e = inputMsgs.GetEnumerator(); while (true) { if (!e.MoveNext()) { yield break; } var msg = e.Current; Interlocked.Increment(ref m_NumMessagesProcessed); if (msg.IsBroken) { LogAgent.LogTrace(TaskType, Name, "Broken message propagates through network. Node: {0}, Message: {1}", Name, msg.Title); } else { LogAgent.LogTrace(TaskType, Name, "Processing: {0}", msg.Title); } yield return(msg); } }