سؤال

In "Introduction to TPL Dataflow" Stephen Toub writes under LinkTo: "... and what the behavior should be if the predicate is not met (e.g. should such a message simply be dropped, should such a message be declined and offered to other targets, etc.)"

In some examples I see a boolean being passed to the LinkTo method after the filter predicate and a parameter discardMessages is mentioned. For instance the links in this nice example Tpl Dataflow walkthrough do not compile:

linkBroadcaster.LinkTo(downloader, linkFilter, true);

I cannot find that parameter in the LinkTo overloads. Has this behavior changed to some default?

هل كانت مفيدة؟

المحلول

The discardMessages parameter has been replaced by

...LinkTo(DataflowBlock.NullTarget)

For a more detailed discussion see Dataflow MSDN forum

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top