If possible I want to create an async-enumerator for tasks launched in parallel. So first to complete is first element of the enumeration, second to finish is second element of
Is this what you're looking for?
public static async IAsyncEnumerable ParallelEnumerateAsync( this IEnumerable> tasks) { var remaining = new List>(tasks); while (remaining.Count != 0) { var task = await Task.WhenAny(remaining); remaining.Remove(task); yield return (await task); } }