Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterable AsyncMultiStream? #5

Open
SF-300 opened this issue Jan 17, 2017 · 1 comment
Open

Iterable AsyncMultiStream? #5

SF-300 opened this issue Jan 17, 2017 · 1 comment

Comments

@SF-300
Copy link

SF-300 commented Jan 17, 2017

Hi! I'm wondering why AsyncMultiStream doesn't inherit from AsyncStreamIterable as AsyncSingleStream does? To me it looks pretty reasonable to iterate hot observables because each observer already actually gets individual AsyncSingleStream during subscription.

@dbrattli
Copy link
Owner

Hi, the reason is that AsyncSingleStream is cold while AsyncMultiStream is hot. Cold means that it will not forward any values before there is a subscriber, and this cannot be enforced with multiple subscribers. But I will most likely remove AsyncStreamIterable from AsyncSingleStream as I'm trying to re-align the project with RxPY and going back to the world of Rx abstractions. Instead there will be a to_async_iterable() function to convert from async push to async pull. To keep the nice syntax for subscribers there will probably be a separate function to use if you want an async iterable instead of a disposable when subscribing, so you can still use async-for directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants