語言

JsonRpcEnumerableSettings.Prefetch 屬性

定義

取得或設定應預先計算並在初始 JSON-RPC 訊息中提供的元素數量,讓接收方不必要求前幾個元素。

public int Prefetch { get; set; }
member this.Prefetch : int with get, set
Public Property Prefetch As Integer

屬性值

備註

此方法僅 IAsyncEnumerable<T> 適用於直接從 RPC 方法返回的物件。

若要預 IAsyncEnumerable<T> 取用於 RPC 方法參數或物件圖中回傳值的物件,請使用 WithPrefetchAsync<T>(IAsyncEnumerable<T>, Int32, CancellationToken) extension 方法,並將此值保持為 0。

適用於