Practice · 2 of 3
Async stream pipeline
CHALLENGE
Difficulty: advanced+25 XP
Implement static async IAsyncEnumerable<int> MultiplyAsync(IAsyncEnumerable<int> source, int factor) yielding each element times factor, and static async Task<List<int>> Collect(IAsyncEnumerable<int> source) materializing a stream to a list. Build the source with an async iterator that yields 1,2,3 with await Task.Yield() between items.
Press Submit to check your solution.
Back to lesson: Practice: Async drills