Context
PSDataverse relies on TPL and custom logic to manage parallel execution of multiple batch requests. The custom logic takes care of distributing the work, managing the max degree of parallelism, merging the result, and piping it back to PowerShell.
What is TPL Dataflow Library?
According to Microsoft Documentation:
The Task Parallel Library (TPL) provides dataflow components to help increase the robustness of concurrency-enabled applications. These dataflow components are collectively referred to as the TPL Dataflow Library. This dataflow model promotes actor-based programming by providing in-process message passing for coarse-grained dataflow and pipelining tasks. The dataflow components build on the types and scheduling infrastructure of the TPL and integrate with the C#, Visual Basic, and F# language support for asynchronous programming.
Benefits
Looking at the official documentation and samples. It seems possible (with a lot of work) to replace the current implementation with the TPL Dataflow library. The added value would be reduction of concern in the current implementation and using a standard approach that can be potentially more familiar to the developers.
It is not clear if switching to TPL Dataflows will have other benefits like better utilization of resources and better error handling or not.
Context
PSDataverse relies on TPL and custom logic to manage parallel execution of multiple batch requests. The custom logic takes care of distributing the work, managing the max degree of parallelism, merging the result, and piping it back to PowerShell.
What is TPL Dataflow Library?
According to Microsoft Documentation:
The Task Parallel Library (TPL) provides dataflow components to help increase the robustness of concurrency-enabled applications. These dataflow components are collectively referred to as the TPL Dataflow Library. This dataflow model promotes actor-based programming by providing in-process message passing for coarse-grained dataflow and pipelining tasks. The dataflow components build on the types and scheduling infrastructure of the TPL and integrate with the C#, Visual Basic, and F# language support for asynchronous programming.
Benefits
Looking at the official documentation and samples. It seems possible (with a lot of work) to replace the current implementation with the TPL Dataflow library. The added value would be reduction of concern in the current implementation and using a standard approach that can be potentially more familiar to the developers.
It is not clear if switching to TPL Dataflows will have other benefits like better utilization of resources and better error handling or not.