Difference between DataflowBlockOptions.BoundedCapacity and BufferBlock<T>

Viewed 2278

Let's assume i have a simple ActionBlock<int>

var actionBlock = new ActionBlock<int>(_ => Console.WriteLine(_));

I can specify a bounded capacity to enable buffering:

var actionBlock = new ActionBlock<int>(
    _ => Console.WriteLine(_),
    new ExecutionDataflowBlockOptions
    { 
        BoundedCapacity = 1000
    });

Is it better to create a BufferBlock<T> and link it to the actionBlock, is it the same, Or is it redundant?

1 Answers
Related