Aggregation and Joins (Inner, Outer, Left, …) with TPL-Dataflow?

那年仲夏 提交于 2020-01-02 07:12:53

问题


Is there any better way to implement functions like aggregation within a TPL-Dataflow mesh than using a BatchBlock to buffer all items until completion, emit them as a collection and then use a transform block to do the actual aggregation?

Similarly, is there any other way to do an inner/outer/left/right join of two datasets without using a BatchedJoinBlock to buffer all items of both datasources, emit them as a tuple of two collections and then do the actual join with a Transform block?


回答1:


No. There is no such mechanism out-of-the-box in TPL Dataflow, as aggregation and joining operations aren't about flowing, they are about querying the data.

However, as the blocks are perfectly fit with RX library, you can use the Join Patterns in Rx paradigm while aggregating your data.

More related links:

  • Aggregation in Rx
  • Reactive Extensions for .NET (Rx): Take action once all events are completed
  • Guide to System.Reactive.Joins


来源:https://stackoverflow.com/questions/46552291/aggregation-and-joins-inner-outer-left-with-tpl-dataflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!