Asynchronous iterator Task<IEnumerable<T>>
I’m trying to implement an asynchronous function that returns an iterator. The idea is the following: private async Task<IEnumerable<char>> TestAsync(string testString) { foreach (char c in testString.ToCharArray()) { // do other work yield return c; } } However, there is an error message that the function cannot be an iterator block because Task<IEnumerable<char>> is not an iterator interface type. Is there a solution? Joe Amenta It sounds like what you may really be looking for is something like IObservable<T> , which is sort of like a push-based asynchronous IEnumerable<T> . See Reactive