Skip to content

Feature request: Async stream generators #8

@omariom

Description

@omariom

Currenty C# supports pull based sequence generators.
As IObservable<T> and IObserver<T> are now in mscorlib and Rx is such a success not only in .NET but in other languages and runtimes why not to add to C# ability to easily create async push based stream generators.

It could look like this:

private async IObservable<string> GetData()
{ 
    var data = await MakeRequest();
    yield return data;
    yield return await MakeAnotherRequest();
}

It would complete language support in the matrix of generators:

sync async
single T Task<T>
multiple IEnumerable<T> IObservable<T>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions