TPL Dataflow by Example
TPL Dataflow by Example
Dataflow and Reactive Programming in .Net
About the Book
The TPL Dataflow Library allows you to design asynchronous Actor and Dataflow based applications. While similar to Microsoft's Reactive Extensions, it goes far beyond what is offered by Rx with a more generalized abstraction to build all types of stream based applications. It does not force you to use IObservable and LINQ, data is simply a stream.
Messages transmit data from one block to another over links. Blocks handle the details of multithreading and execute anytime they receive data. All you have to think about is programming the blocks to do what you want. Focus on the problem domain not asynchronous details.
Downloadable code examples are used throughout the book to explain the library with a hands-on approach (ftp://DataflowBook.com).
For a complete understanding of dataflow theory and application, please see my other book "Dataflow and Reactive Programming Systems". While chapter two of this book is included in my other book, it does not contain best practices and program design tips specific to TPL Dataflow.
- Other Dataflow Books
- Code Examples
1 Getting Started
- 1.1 What is TPL Dataflow
- 1.2 What is Dataflow
- 1.3 Where is Dataflow Used?
- 1.4 TPL Dataflow vs. Rx
- 1.5 Installing TPL Dataflow
2 TPL Dataflow Basics
2.1.1 Execution Blocks
- 126.96.36.199 ActionBlock<T>
- 188.8.131.52 TransformBlock<T1,T2>
- 184.108.40.206 Block Configuration
- 220.127.116.11 Execution Block Options
2.1.2 Buffering Blocks
- 18.104.22.168 BufferBlock<T>
- 22.214.171.124 BroadcastBlock<T>
- 126.96.36.199 WriteOnceBlock<T>
- 188.8.131.52 DataflowBlockOptions
2.1.3 Grouping Blocks
- 184.108.40.206 BatchBlock<T>
- 220.127.116.11 JoinBlock<T1,T2>
- 18.104.22.168 BatchedJoinBlock<T1,T2>
- 22.214.171.124 GroupingDataflowBlockOptions
- 2.1.4 Block Completion
- 2.1.1 Execution Blocks
- 2.2.1 DataflowLinkOptions
- 2.1 Blocks
3 Using TPL Dataflow
- 3.1 A Generator Block
- 3.2 How Messages are Transmitted
- 3.3 Runtime Modification
- 3.4 Maintaining State Inside an Execution Block
- 3.5 Converting a Stateful Block to be Stateless
4 Dataflow Program Design
4.1 Block Design
- 4.1.1 Design for Reuse
- 4.1.2 Create Blocks from Scratch only when Necessary
- 4.1.3 Develop Your Own Block Interface
- 4.1.4 Careful with Retaining State in Blocks
- 4.2 Favor Application Specific Blocks Over Predefined Blocks
- 4.3 Avoid Excess Synchronization and Blocks
- 4.4 Dealing with Loops and Cycles
- 4.5 Prevent Large Buffers
- 4.6 Data Should be Immutable
- 4.7 Use SingleProducerConstrained if Possible
- 4.1 Block Design
The Leanpub 60-day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
80% Royalties. Earn $16 on a $20 book.
We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.