-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add flatten
to Source[T]
#198
Conversation
forkPropagate(c2) { | ||
var pool = List[Source[T] | Source[U]](this) | ||
repeatWhile { | ||
selectOrClosed(pool) match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact that we can not know the result of select stems from which select statement is limiting. In Golang there's a hacky way to do it.
https://stackoverflow.com/a/19992525/1556045
I think both (v: V)
or (c: ChannelClosed)
results if they hint that which select/source they stem from would make the API more robust.
Update: created a ticket for it as Adam suggested #201
Thanks for the PR - the only reason such a method didn't exist before is because nobody wrote it :). There are some test failures, though. As for adding a select variant which would also return the clause which was completed - maybe you can create a separate issue for that? |
flatten
extension method for Source[Source[T]]flatten
to Source[T]
Thanks for taking a look @adamw, I created a new ticket and made the test pass. Let me know if there's any concern with the readability of the tests or more test cases would help. |
The test are great, thanks! :) |
To address #197