/// <summary> /// Sends the downstream. /// </summary> /// <param name="message">The message.</param> /// <exception cref="System.InvalidOperationException">Failed to find a next handler.</exception> public void SendDownstream(IDownstreamMessage message) { if (_next == null) { throw new InvalidOperationException("Failed to find a next handler."); } _next.Invoke(message); }
/// <summary> /// Invokes all downstream messages. /// </summary> public void InvokeDownstream() { IDownstreamMessage message; while (_downMessages.TryDequeue(out message)) { _down.Invoke(message); } }