Share via


JsonRpcEnumerableSettings.Prefetch Property

Definition

Gets or sets the number of elements that should be precomputed and provided in the initial JSON-RPC message so the receiving party does not neet to request the initial few elements.

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

Property Value

Remarks

This should only be used for IAsyncEnumerable<T> objects returned directly from an RPC method.

To prefetch items for IAsyncEnumerable<T> objects used as arguments to an RPC method or within an object graph of a returned value, use the WithPrefetchAsync<T>(IAsyncEnumerable<T>, Int32, CancellationToken) extension method instead and leave this value at 0.

Applies to