renestein / Rstein.AsyncCpp

The RStein.AsyncCpp library is a set of types that should be familiar for anyone who knows the Task Parallel Library (TPL) for .NET (C#).
MIT License
31 stars 4 forks source link

Support BufferBlock in DataFlow? #36

Closed npuichigo closed 1 year ago

npuichigo commented 2 years ago

Will you implement BufferBlock counterpart in DataFlow here? I think it's a useful feature to work together with coroutine.

renestein commented 2 years ago

Thanks for your suggestion. What do you expect from the "BufferBlock"? The current version of the TransformBlock uses ThreadSafeMinimalisticQueue . ThreadSafeMinimalisticQueue is a queue (FIFO container) typically used in BufferBlock. So the instance of the TransformBlock, which does not transform items, but only "propagates" items might play a role of the "BufferBlock" in the solution. But the TransformBlock is not a good fit in case you need a "bounded" block - producer of the items is blocked when the max limit of the items in the block is reached.