Push based coroutines #9370
Unanswered
fedeAlterio
asked this question in
Language Ideas
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
C# has excellent language support for pull-based streams using constructs like yield return, (await) foreach, and interfaces such as IEnumerable and IAsyncEnumerable.
However, push-based streams, represented by IObservable (and potentially IAsyncObservable) do not have this support.
Proposed Syntax: notify and (await) wheneach
Basically calling notify "teleports the execution" to the body of the wheneach
An exception should be rethrown on wheneach in an error is notified, and an exception in the coroutine should become an onError notification.
Reaching the end of the method means completing the observable.
break a wheneach means to unsubscribe from the observable
Beta Was this translation helpful? Give feedback.
All reactions