I've got some questions about Bufferblock and Dataflow processing in
general. Suppose I have a set up something like the following (I
copied this code from another question, but it serves to illustrate)
var forwarder = new BufferBlock<SomeType>();
forwarder.LinkTo(target1, item => matchesTarget1(item));
forwarder.LinkTo(target2, item => matchesTarget2(item));
forwarder.LinkTo(DataflowBlock.NullTarget<SomeType>());
Q1. Assuming no concurrency settings, if I add 1000 items which match
Target1 to the forwarder, are they all instantly posted to target1?
i.e. Does the queuing occur within target1, and so the forwarder (BufferBlock) is now empty? I believe yes, which means that the buffer instantly empties itself? Or does target1 refuse things when it decides it can't cope with any more?
Q2. Assuming I set maxdegreeofparallelism of target1 to, say, 4, I
believe this will mean that things will stay in the buffer until the
target is capable of processing them. But does that mean that, if my
queue looked like this, for example:
target1Item
target1Item
target1Item
target1Item
target1Item
target2Item
target2Item
target2Item
Then target2 would not be offered anything to do at all until all 5
target1Items had been accepted. If target1 is a slow process, that
means that target2 may sit around doing nothing when it could be
making itself useful.
I've read and read about this, but I can't find anything which
definitively answers this. Any help would be greatly appreciated.
Thanks