/// <summary>
        /// Receive a sublist of messages sent from the IScatterSender.
        /// </summary>
        /// <returns>The sublist of messages</returns>
        public List <T> Receive(CancellationTokenSource cancellationSource = null)
        {
            IList <T> elements = _topology.ReceiveListFromParent(cancellationSource);

            _topology.ScatterToChildren(elements, MessageType.Data);
            return(elements.ToList());
        }
Beispiel #2
0
        /// <summary>
        /// Receive a sublist of messages sent from the IScatterSender.
        /// </summary>
        /// <returns>The sublist of messages</returns>
        public List <T> Receive()
        {
            IList <T> elements = _topology.ReceiveListFromParent();

            _topology.ScatterToChildren(elements, MessageType.Data);
            return(elements.ToList());
        }
 /// <summary>
 /// Split up the list of elements evenly and scatter each chunk
 /// to the IScatterReceivers.
 /// </summary>
 /// <param name="elements">The list of elements to send.</param>
 public void Send(List <T> elements)
 {
     _topology.ScatterToChildren(elements, MessageType.Data);
 }