title: Most Optimal TPL Dataflow Design?
body: <p>I like to ask for input how to best design the most optimal architecture using TPL Dataflow. I do not have written code yet so there is no sample code I can post. I am not looking for code (unless volunteered) either but assistance in the design would be much appreciated:</p>
  
  <p>The requirements are as follows:</p>
  
  <p>I have 3 core datablocks that are dependent on each other in specific ways. Datablock1 is a producer that produces objects of type Foo1. Datablock2 is supposed to subscribe to Foo1 objects (from Datablock1) and potentially (not upon each and every Foo1, subject to a specific function) produce Foo2 objects that it stores in an output queue for other datablocks to consume. Datablock3 also consumes Foo1 objects (from Datablock1) and potentially produces Foo3 objects that Datablock2 consumes and transforms into Foo2 objects. </p>
  
  <p>In summary, here are the datablocks and what they each produce and consume:</p>
  
  <ul>
  <li>Datablock1: Produces(Foo1), Consumes(Nothing)</li>
  <li>Datablock2: Produces(Foo2), Consumes(Foo1, Foo3)</li>
  <li>Datablock3: Produces(Foo3), Consumes(Foo1)</li>
  </ul>
  
  <p>An additional requirement is that that the same Foo1 are processed at about the same time in Datablock2 and Datablock3. It would be ok if Foo1 objects are first consumed by Datablock2 and then once Datablock2 has done its work the very same Foo1 objects are posted to Datablock3 for it to do its work. Foo2 objects from Datablock2 can result from either operations on Foo1 objects or Foo3 objects.</p>
  
  <p>I hope this makes sense, I am happy to explain more if it is still unclear.</p>
  
  <p>My first idea was to create TPL Dataflowblocks for each of the 3 datablocks and to make them handle incoming streams of different object types. Another idea is to split up datablocks and have each datablock only handle streams of one single object type. What do you recommend or is there an even better solution that may work?  </p>
  
  <p>Svick has already helped on the Datablock1 and it is already operational, I am just stuck on how to go about transforming my current environment (as described above) to TPL Dataflow. </p>
  
  <p>Any ideas or pointers are much appreciated.</p>