JsonRpcEnumerableSettings.Prefetch 屬性

定義

取得或設定應該在初始 JSON-RPC 訊息中預先計算並提供的專案數目,讓接收者不會設定要求初始幾個元素。

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

屬性值

備註

這只應該用於 IAsyncEnumerable<T> 直接從 RPC 方法傳回的物件。

若要預先擷取做為 RPC 方法引數的物件或傳回值之物件圖形內的專案 IAsyncEnumerable<T> ,請改用 WithPrefetchAsync<T>(IAsyncEnumerable<T>, Int32, CancellationToken) 擴充方法,並將此值保留為 0。

適用於