Chapter 7: Task Parallel Library (TPL) and Dataflow
The Task Parallel Library (TPL) dataflow library contains building blocks to orchestrate asynchronous workflows in .NET. This chapter will introduce the TPL Dataflow library, describe the types of dataflow blocks in the library, and illustrate some common patterns for using dataflow blocks through hands-on examples.
The dataflow library can be useful when processing large amounts of data in multiple stages or when your application receives data in a continuous stream. The dataflow blocks provide a fantastic way of implementing the producer/consumer design pattern.
To understand this, we will create a sample project that implements this pattern and examine other real-world uses of the dataflow library.
Note
It’s important to know that the TPL Dataflow library isn’t distributed as part of the .NET runtime or SDK. It’s available as a NuGet package from Microsoft. We will add it to our sample projects...