Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8926617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:00:57+00:00 2026-06-15T08:00:57+00:00

I am looking for a TPL data flow block solution which can hold more

  • 0

I am looking for a TPL data flow block solution which can hold more than a single item, which can link to multiple target blocks, but which has the ability to forward an item to only a specific target block that passes a filter/predicate. At no time should an item be delivered to multiple target blocks at the same time, always only to the one which matches the filter or the item can be discarded. I am not fond of BroadCastBlock because, if I understand correctly, it does not guarantee delivery (or does it?) and the filtering is done on the target block side, meaning BroadCastBlock essentially sends copies of each item to all linkedTo target blocks. It also does not hold more than one item at any time if I understand correctly. I do not want to use Post/Async but maintain a LinkTo chain.

Is there a way around a complete custom data flow block? Or am I misunderstanding how BroadCastBlock works? Unfortunately there really is not much documentation out there that goes into detail and covers use cases. Any ideas are highly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:00:58+00:00Added an answer on June 15, 2026 at 8:00 am

    If I understand you correctly, what you want could be accomplished by a simple BufferBlock, which would be linked to all your target blocks with predicates. You would also (unconditionally) link it to a NullTarget block, to discard items that didn’t match.

    Something like:

    var forwarder = new BufferBlock<SomeType>();
    forwarder.LinkTo(target1, item => matchesTarget1(item));
    forwarder.LinkTo(target2, item => matchesTarget2(item));
    forwarder.LinkTo(DataflowBlock.NullTarget<SomeType>());
    

    This way, each item will be sent to the first target that matches, if there is any.

    BroadcastBlock can be useful if you want to send each item to multiple targets, or if you want to discard items if the target block is not fast enough.

    With BroadcastBlock, items may be dropped if no block accepts them (even though they may be able to accept it later). But it doesn’t drop items at random, so if your target blocks don’t have BoundedCapacity set, I think you can be sure that they will get all items that they don’t decline (e.g. by using predicate in LinkTo()).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking for a way to enable someone to upload a single file which will
I'm looking at the TPL exception handling example from MSDN @ http://msdn.microsoft.com/en-us/library/dd537614(v=VS.100).aspx The basic
In particular, I'm looking at using TPL to start (and wait for) external processes.
Looking for C# class which wraps calls to do the following: read and write
Looking at the following code, does theme[sprite].img get nested inside result[definition].data (as theme[sprite].img is
Looking for more detailed info on how to read the NAL header and more
I was going to play around with TPL dataflow, but I can't seem to
can I somehow add paths where Dwoo is looking for templates from? I have
Looking for a general case solution to determine if any jquery dialog (there are
Looking for a C++ async HTTP library so I can download some zip files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.