AnonymousAsyncGenerator<TOutput>

Namespace: SnowBank.Linq.Async.Iterators · class

Implements: AsyncLinqIterator<TOutput>, IAsyncLinqQuery<TOutput>, IAsyncQuery<TOutput>, IAsyncEnumerable<TOutput>, IAsyncEnumerator<TOutput>, IAsyncDisposable

Generate items asynchronously, using a user-provided lambda

Constructors

AnonymousAsyncGenerator<TOutput>

AnonymousAsyncGenerator<TOutput>(Func<long, CancellationToken, Task<Maybe<TOutput>>> generator, CancellationToken ct)

AnonymousAsyncGenerator<TOutput>(Func<long, CancellationToken, ValueTask<Maybe<TOutput>>> generator, CancellationToken ct)

Properties

Cancellation

CancellationToken Cancellation { get; }

Cancellation token that should be used by all async operations performed in the context of this query

This token is controlled by the source (usually a transaction or other transient scope)