Beispiel #1
0
		public BroadcastBlock (Func<T, T> cloner, DataflowBlockOptions dataflowBlockOptions)
		{
			if (dataflowBlockOptions == null)
				throw new ArgumentNullException ("dataflowBlockOptions");

			this.cloner = cloner;
			this.dataflowBlockOptions = dataflowBlockOptions;
			this.messageBox = new PassingMessageBox<T> (messageQueue, compHelper, () => outgoing.IsCompleted, BroadcastProcess, dataflowBlockOptions);
			this.outgoing = new MessageOutgoingQueue<T> (compHelper, () => messageQueue.IsCompleted);
			this.vault = new MessageVault<T> ();
		}
Beispiel #2
0
        public WriteOnceBlock(Func <T, T> cloner, DataflowBlockOptions dataflowBlockOptions)
        {
            if (dataflowBlockOptions == null)
            {
                throw new ArgumentNullException("dataflowBlockOptions");
            }

            this.cloner = cloner;
            this.dataflowBlockOptions = dataflowBlockOptions;
            this.messageBox           = new PassingMessageBox <T> (messageQueue, compHelper, () => true, BroadcastProcess, dataflowBlockOptions);
            this.vault = new MessageVault <T> ();
        }
Beispiel #3
0
        public BufferBlock(DataflowBlockOptions dataflowBlockOptions)
        {
            if (dataflowBlockOptions == null)
            {
                throw new ArgumentNullException("dataflowBlockOptions");
            }

            this.dataflowBlockOptions = dataflowBlockOptions;
            this.messageBox           = new PassingMessageBox <T> (messageQueue, compHelper, () => outgoing.IsCompleted, ProcessQueue, dataflowBlockOptions);
            this.outgoing             = new MessageOutgoingQueue <T> (compHelper, () => messageQueue.IsCompleted);
            this.vault = new MessageVault <T> ();
        }
Beispiel #4
0
        public BatchBlock(int batchSize, DataflowBlockOptions dataflowBlockOptions)
        {
            if (dataflowBlockOptions == null)
            {
                throw new ArgumentNullException("dataflowBlockOptions");
            }

            this.batchSize            = batchSize;
            this.dataflowBlockOptions = dataflowBlockOptions;
            this.messageBox           = new PassingMessageBox <T> (messageQueue, compHelper, () => outgoing.IsCompleted, BatchProcess, dataflowBlockOptions);
            this.outgoing             = new MessageOutgoingQueue <T[]> (compHelper, () => messageQueue.IsCompleted);
            this.vault = new MessageVault <T[]> ();
        }
Beispiel #5
0
        public TransformBlock(Func <TInput, TOutput> transformer, ExecutionDataflowBlockOptions dataflowBlockOptions)
        {
            if (dataflowBlockOptions == null)
            {
                throw new ArgumentNullException("dataflowBlockOptions");
            }

            this.transformer          = transformer;
            this.dataflowBlockOptions = dataflowBlockOptions;
            this.messageBox           = new ExecutingMessageBox <TInput> (messageQueue,
                                                                          compHelper,
                                                                          () => outgoing.IsCompleted,
                                                                          TransformProcess,
                                                                          dataflowBlockOptions);
            this.outgoing = new MessageOutgoingQueue <TOutput> (compHelper, () => messageQueue.IsCompleted);
            this.vault    = new MessageVault <TOutput> ();
        }