AsyncIterationHint
Namespace: SnowBank.Linq · enum
Implements: IComparable, ISpanFormattable, IFormattable, IConvertible
Defines the intent of a consumer of an async query
Fields
All
All = 2
The query will consume all the items in the source. The provider will produce large chunks of data immediately, and reduce the number of pages needed to consume the sequence.
Default
Default = 0
Use the default settings. The provider will make no attempt at optimizing the query.
Head
Head = 3
The query will consume the first element (or a very small fraction) of the source. The provider will only produce data in small chunks and expect the caller to abort after one or two iterations. This can also be used to reduce the latency of the first result.
Iterator
Iterator = 1
The query will be consumed by chunks and may be aborted at any point. The provider will produce small chunks of data for the first few reads but should still be efficient if the caller consume all the sequence.
This is ideal for queries that may need to read more than one element to complete, like for example FirstOrDefaultAsync or AnyAsync.
The source can use this hint to only fetch a limited number of results during the initial fetch, and slowly grow the page size as needed.