/// <summary> /// The AggregatorArrow produces a side effect that is the provided collection /// filled with the contents of all the objects that have passed through it. /// The collection enumerator is used as the emitting enumerator. Thus, what /// goes into AggregatorArrow may not be the same as what comes out of /// AggregatorPipe. /// For example, duplicates removed, different order to the stream, etc. /// Finally, note that different Collections have different behaviors and /// write/read times. /// </summary> /// <param name="ArrowSender">The sender of the messages/objects.</param> /// <param name="ICollection">An optional ICollection to store the passed messages/objects.</param> /// <param name="Recipient">A recipient of the processed messages.</param> /// <param name="Recipients">Further recipients of the processed messages.</param> public static AggregatorArrow <TMessage> Aggregator <TMessage>(this IArrowSender <TMessage> ArrowSender, ICollection <TMessage> ICollection, MessageRecipient <TMessage> Recipient, params MessageRecipient <TMessage>[] Recipients) { var _AggregatorArrow = new AggregatorArrow <TMessage>(ICollection, Recipient, Recipients); ArrowSender.OnMessageAvailable += _AggregatorArrow.ReceiveMessage; return(_AggregatorArrow); }
/// <summary> /// The AggregatorArrow produces a side effect that is the provided collection /// filled with the contents of all the objects that have passed through it. /// The collection enumerator is used as the emitting enumerator. Thus, what /// goes into AggregatorArrow may not be the same as what comes out of /// AggregatorPipe. /// For example, duplicates removed, different order to the stream, etc. /// Finally, note that different Collections have different behaviors and /// write/read times. /// </summary> /// <param name="ArrowSender">The sender of the messages/objects.</param> /// <param name="ICollection">An optional ICollection to store the passed messages/objects.</param> public static AggregatorArrow <TMessage> Aggregator <TMessage>(this IArrowSender <TMessage> ArrowSender, ICollection <TMessage> ICollection = null) { var _AggregatorArrow = new AggregatorArrow <TMessage>(ICollection); ArrowSender.OnMessageAvailable += _AggregatorArrow.ReceiveMessage; return(_AggregatorArrow); }