public static async Task UntilAsync <T>(this IAsyncEnumerator <T> e, Func <T, bool> until, AsyncEnumerator <T> .Yield yield = null) { await e.ForEachAsync(t => { if (!until(t)) { if (yield != null) { yield.Break(); } e.Dispose(); } }); }