Ejemplo n.º 1
0
 public UnfoldArrow(IArrowSender <IEnumerable <T> > In = null)
 {
     if (In != null)
     {
         In.SendTo(this);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new abstract arrow receiver.
        /// </summary>
        /// <param name="ArrowSender">The sender of the messages/objects.</param>
        public AbstractArrowReceiver(IArrowSender <TIn> ArrowSender = null)
        {
            this._WasStarted  = false;
            this._IsCompleted = false;

            if (ArrowSender != null)
            {
                ArrowSender.SendTo(this);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Filters the consuming objects by calling a Func&lt;S, Boolean&gt;.
        /// </summary>
        /// <param name="Func">A Func&lt;S, Boolean&gt; filtering the consuming objects. True means filter (ignore).</param>
        internal ArrowSink(IArrowSender <TIn> INotification)
        {
            if (INotification != null)
            {
                INotification.SendTo(this);
            }

            this.BlockingCollection  = new BlockingCollection <TIn>();
            this._InternalEnumerator = BlockingCollection.GetConsumingEnumerable().GetEnumerator();
        }
Ejemplo n.º 4
0
        public SplitUDPPacketArrow(IArrowSender <UDPPacket <IEnumerable <T> > > In = null)

            : base(Messages => Messages.Payload.
                   Select(Message => new UDPPacket <T>(null,
                                                       Messages.ServerTimestamp,
                                                       Messages.LocalSocket,
                                                       Messages.RemoteSocket,
                                                       Message)))

        {
            if (In != null)
            {
                In.SendTo(this);
            }
        }
Ejemplo n.º 5
0
        public ProcessUDPPacketArrow(Func <TIn, TOut> MessageProcessor,
                                     Func <Exception, Exception> OnError = null,
                                     IArrowSender <UDPPacket <TIn> > In  = null)

            : base(PacketIn => new UDPPacket <TOut>(
                       null,
                       PacketIn.ServerTimestamp,
                       PacketIn.LocalSocket,
                       PacketIn.RemoteSocket,
                       MessageProcessor(PacketIn.Payload)),
                   OnError)

        {
            if (In != null)
            {
                In.SendTo(this);
            }
        }