BatchBlock<T> Constructors

Definition

Overloads

BatchBlock<T>(Int32)

Initializes a new BatchBlock<T> with the specified batch size.

BatchBlock<T>(Int32, GroupingDataflowBlockOptions)

Initializes a new BatchBlock<T> with the specified batch size, declining option, and block options.

BatchBlock<T>(Int32)

Source:
BatchBlock.cs
Source:
BatchBlock.cs
Source:
BatchBlock.cs
Source:
BatchBlock.cs

Initializes a new BatchBlock<T> with the specified batch size.

C#
public BatchBlock(int batchSize);

Parameters

batchSize
Int32

The number of items to group into a batch.

Exceptions

The batchSize must be positive.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0

BatchBlock<T>(Int32, GroupingDataflowBlockOptions)

Source:
BatchBlock.cs
Source:
BatchBlock.cs
Source:
BatchBlock.cs
Source:
BatchBlock.cs

Initializes a new BatchBlock<T> with the specified batch size, declining option, and block options.

C#
public BatchBlock(int batchSize, System.Threading.Tasks.Dataflow.GroupingDataflowBlockOptions dataflowBlockOptions);

Parameters

batchSize
Int32

The number of items to group into a batch.

dataflowBlockOptions
GroupingDataflowBlockOptions

The options with which to configure this BatchBlock<T>.

Exceptions

The batchSize must be positive.

-or-

The batchSize must be smaller than the value of the BoundedCapacity option if a non-default value has been set.

The dataflowBlockOptions is null.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0