public void NotifySegmentCaptured(CapturedOutputSegment segment) { lock (mutex) { var handlers = SegmentCaptured?.GetInvocationList(); if (handlers == null) { return; } foreach (Action <CapturedOutputSegment> handler in handlers) { try { handler.Invoke(segment); } catch (Exception e) { Log.Error(TAG, $"bad SegmentCaptured handler ({handler})", e); } } } }
void CapturedOutputWriter_SegmentCaptured(CapturedOutputSegment segment) => agent.MessageChannel.Push(segment);