Пример #1
0
        /// <summary>
        /// The CountArrow produces a side effect that is the total
        /// number of messages/objects that have passed through it.
        /// </summary>
        /// <param name="ArrowSender">The sender of the messages/objects.</param>
        /// <param name="InitialValue">The initial value of the counter.</param>
        /// <param name="Recipient">A recipient of the processed messages.</param>
        /// <param name="Recipients">Further recipients of the processed messages.</param>
        public static CountArrow <TMessage> Count <TMessage>(this IArrowSender <TMessage> ArrowSender, Int64 InitialValue, IArrowReceiver <TMessage> Recipient, params IArrowReceiver <TMessage>[] Recipients)
        {
            var _CountArrow = new CountArrow <TMessage>(InitialValue, Recipient, Recipients);

            ArrowSender.OnMessageAvailable += _CountArrow.ReceiveMessage;
            return(_CountArrow);
        }
Пример #2
0
        /// <summary>
        /// The CountArrow produces a side effect that is the total
        /// number of messages/objects that have passed through it.
        /// </summary>
        /// <param name="ArrowSender">The sender of the messages/objects.</param>
        /// <param name="InitialValue">The initial value of the counter.</param>
        public static CountArrow <TMessage> Count <TMessage>(this IArrowSender <TMessage> ArrowSender, Int64 InitialValue = 0L)
        {
            var _CountArrow = new CountArrow <TMessage>(InitialValue);

            ArrowSender.OnMessageAvailable += _CountArrow.ReceiveMessage;
            return(_CountArrow);
        }