Chapter 4. Dataflow Basics
TPL Dataflow is a powerful library that allows you to create a mesh or pipeline and then (asynchronously) send your data through it. Dataflow is a very declarative style of coding; normally, you completely define the mesh first and then start processing data. The mesh ends up being a structure through which your data flows. This requires you to think about your application a bit differently, but once you make that leap, Dataflow becomes a natural fit for many scenarios.
Each mesh is comprised of various blocks that are linked to each other. The individual blocks are simple and are responsible for a single step in the data processing. When a block finishes working on its data, it will pass it along to any linked blocks.
To use TPL Dataflow, install the NuGet package Microsoft.Tpl.Dataflow into your application. The TPL Dataflow library has limited platform support for older platforms (Table 4-1):
| Platform | Dataflow support |
.NET 4.5 |
|
.NET 4.0 |
|
Mono iOS/Droid |
|
Windows Store |
|
Windows Phone Apps 8.1 | |
Windows Phone SL 8.0 | |
Windows Phone SL ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access