Table of Contents

Class JsonRpcEnumerableSettings

Namespace
StreamJsonRpc
Assembly
StreamJsonRpc.dll

Provides customizations on performance characteristics of an IAsyncEnumerable<T> that is passed over JSON-RPC.

public class JsonRpcEnumerableSettings
Inheritance
JsonRpcEnumerableSettings
Inherited Members

Properties

MaxReadAhead

Gets or sets the maximum number of elements to read ahead and cache from the generator in anticipation of the consumer requesting those values.

public int MaxReadAhead { get; set; }

Property Value

int

This value must be a non-negative number.

MinBatchSize

Gets or sets the minimum number of elements to obtain from the generator before sending a batch of values to the consumer.

public int MinBatchSize { get; set; }

Property Value

int

This must be a positive integer.

Prefetch

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; }

Property Value

int

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>, int, CancellationToken) extension method instead and leave this value at 0.