No, you cannot "incomplete" a populated data stream block. I think you should add a flag for each message that says whether the last message will be in the run. To make it easier to work with, you can create a set of helper methods, such as:
public static TransformBlock<Tuple<TInput, bool>, Tuple<TOutput, bool>>
CreateEnhancedTransformBlock<TInput, TOutput>(Func<TInput, TOutput> transform)
{
return new TransformBlock<Tuple<TInput, bool>, Tuple<TOutput, bool>>(
tuple => Tuple.Create(transform(tuple.Item1), tuple.Item2));
}
So you enter a delegate transformthat deals only with TInputand TOuput, and the flag is passed along with each message.
svick source
share