Channel.CreateBounded 方法

定義

多載

名稱 Description
CreateBounded<T>(Int32)

建立一個符合指定最大容量的通道。

CreateBounded<T>(BoundedChannelOptions)

建立一個符合指定最大容量的通道。

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

建立一個受限於所提供選項的頻道。

CreateBounded<T>(Int32)

來源:
Channel.cs
來源:
Channel.cs
來源:
Channel.cs
來源:
Channel.cs
來源:
Channel.cs
來源:
Channel.cs

建立一個符合指定最大容量的通道。

public:
generic <typename T>
 static System::Threading::Channels::Channel<T> ^ CreateBounded(int capacity);
public static System.Threading.Channels.Channel<T> CreateBounded<T>(int capacity);
static member CreateBounded : int -> System.Threading.Channels.Channel<'T>
Public Shared Function CreateBounded(Of T) (capacity As Integer) As Channel(Of T)

類型參數

T

指定通道中的資料類型。

參數

capacity
Int32

頻道可儲存的最大項目數量。

傳回

已建立的頻道。

例外狀況

capacity 為負數。

備註

使用此方法建立的通道會執行該 Wait 行為,並禁止繼續同步執行。

適用於

CreateBounded<T>(BoundedChannelOptions)

來源:
Channel.cs
來源:
Channel.cs
來源:
Channel.cs
來源:
Channel.cs
來源:
Channel.cs
來源:
Channel.cs

建立一個符合指定最大容量的通道。

public:
generic <typename T>
 static System::Threading::Channels::Channel<T> ^ CreateBounded(System::Threading::Channels::BoundedChannelOptions ^ options);
public static System.Threading.Channels.Channel<T> CreateBounded<T>(System.Threading.Channels.BoundedChannelOptions options);
static member CreateBounded : System.Threading.Channels.BoundedChannelOptions -> System.Threading.Channels.Channel<'T>
Public Shared Function CreateBounded(Of T) (options As BoundedChannelOptions) As Channel(Of T)

類型參數

T

指定通道中的資料類型。

參數

options
BoundedChannelOptions

引導頻道行為的選項。

傳回

已建立的頻道。

例外狀況

optionsnull

適用於

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

來源:
Channel.cs
來源:
Channel.cs
來源:
Channel.cs
來源:
Channel.cs
來源:
Channel.cs
來源:
Channel.cs

建立一個受限於所提供選項的頻道。

public:
generic <typename T>
 static System::Threading::Channels::Channel<T> ^ CreateBounded(System::Threading::Channels::BoundedChannelOptions ^ options, Action<T> ^ itemDropped);
public static System.Threading.Channels.Channel<T> CreateBounded<T>(System.Threading.Channels.BoundedChannelOptions options, Action<T>? itemDropped);
static member CreateBounded : System.Threading.Channels.BoundedChannelOptions * Action<'T> -> System.Threading.Channels.Channel<'T>
Public Shared Function CreateBounded(Of T) (options As BoundedChannelOptions, itemDropped As Action(Of T)) As Channel(Of T)

類型參數

T

指定通道中的資料類型。

參數

options
BoundedChannelOptions

引導頻道行為的選項。

itemDropped
Action<T>

當商品從頻道被下架時,會被叫去。 參見 BoundedChannelFullMode

傳回

已建立的頻道。

例外狀況

optionsnull

適用於