Channel.CreateBounded Method

Definition

Overloads

CreateBounded<T>(Int32)

Creates a channel with the specified maximum capacity.

CreateBounded<T>(BoundedChannelOptions)

Creates a channel with the specified maximum capacity.

CreateBounded<T>(BoundedChannelOptions, Action<T>)

Creates a channel subject to the provided options.

CreateBounded<T>(Int32)

Source:
Channel.cs
Source:
Channel.cs
Source:
Channel.cs
Source:
Channel.cs

Creates a channel with the specified maximum capacity.

public static System.Threading.Channels.Channel<T> CreateBounded<T> (int capacity);

Type Parameters

T

Specifies the type of data in the channel.

Parameters

capacity
Int32

The maximum number of items the channel may store.

Returns

The created channel.

Remarks

Channels created with this method apply the Wait behavior and prohibit continuations from running synchronously.

Applies to

.NET 9 およびその他のバージョン
製品 バージョン
.NET Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

CreateBounded<T>(BoundedChannelOptions)

Source:
Channel.cs
Source:
Channel.cs
Source:
Channel.cs
Source:
Channel.cs

Creates a channel with the specified maximum capacity.

public static System.Threading.Channels.Channel<T> CreateBounded<T> (System.Threading.Channels.BoundedChannelOptions options);

Type Parameters

T

Specifies the type of data in the channel.

Parameters

options
BoundedChannelOptions

Options that guide the behavior of the channel.

Returns

The created channel.

Applies to

.NET 9 およびその他のバージョン
製品 バージョン
.NET Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

CreateBounded<T>(BoundedChannelOptions, Action<T>)

Source:
Channel.cs
Source:
Channel.cs
Source:
Channel.cs
Source:
Channel.cs

Creates a channel subject to the provided options.

public static System.Threading.Channels.Channel<T> CreateBounded<T> (System.Threading.Channels.BoundedChannelOptions options, Action<T>? itemDropped);

Type Parameters

T

Specifies the type of data in the channel.

Parameters

options
BoundedChannelOptions

Options that guide the behavior of the channel.

itemDropped
Action<T>

Delegate that will be called when item is being dropped from channel. See BoundedChannelFullMode.

Returns

The created channel.

Applies to

.NET 9 およびその他のバージョン
製品 バージョン
.NET 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)