<PackageReference Include="AsyncEnumerator" Version="4.0.2" />

Dasync.Collections.AsyncEnumerableWithState<TItem, TState>

Similar to AsyncEnumerable<T>, but allows you to pass a state object into the enumeration function, what can be used for performance optimization, so don't have to create a delegate on the fly every single time you create the enumerator.
namespace Dasync.Collections { public class AsyncEnumerableWithState<TItem, TState> : AsyncEnumerable, IAsyncEnumerable, IAsyncEnumerable<TItem> { protected TState State { get; } public AsyncEnumerableWithState(Func<AsyncEnumerator<TItem>.Yield, TState, Task> enumerationFunction, TState state); public virtual IAsyncEnumerator<TItem> GetAsyncEnumerator(CancellationToken cancellationToken = default(CancellationToken)); } }