I need to return a collection of items with the push-model (as opposed to pull, like IEnumerable). However, I’m not sure if I should use IObservable from reactive extensions or ISourceBlock from TPL Dataflow.
They seem very similar, under what circumstances should one choose one over the other?
Basically, I think the answer comes down to how are you going to use the results. If you want to process them using TPL Dataflow, return
ISourceBlock<T>. If you’re going to process them using Rx, useIObservable<T>.If you don’t know, I think it’s better to return
ISourceBlock<T>, because it can be easily converted toIObservable<T>.