This repository has been archived by the owner on Feb 24, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds Stream.callback #199
Adds Stream.callback #199
Changes from 25 commits
1359f2f
e86280b
5e82a12
2babd55
0db7bfc
574a3fe
4952430
2d86e1f
b02f381
6e8ab19
7f2af2c
5506cd1
44abbde
a021f9d
12e526c
f75f8ab
e8c0100
bbfb358
fd531ee
a46c9a0
2f77e93
ac58a0b
d1f8af9
6520aef
6723497
0dfb150
4391944
17430b6
35a1840
c0f9a19
543816a
6b815f6
f3d0121
40ba5a4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Should we include an option for emitting a
Stream<A>
?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.
Could potentially emit with two strategies:
The end result would be similar to concatenate and merge operations respectively
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.
I believe one could achieve the same by just combining that possible Stream with the callback itself, no?
Stream.callback { ... }.merge(Stream.xxx)
Stream.callback { ... }.flatMap(Stream.xxx).parJoinUnbounded()
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.
That's ok if we have knowledge of the other stream outside. My thinking was if we require to do conditions inside the callback...
So, depending on the value we get from a given callback we could start one or another.
One use case I can think of for the secuencial emit could be, if we have a lifecycle callback that generates a new stream of user events each time, ending the previous one. This way we could generate a seamless continuous stream of user events.
As for the parallel emit we could have something that listens to multiple UI elements (like selectable items) and would mean we can combine them all into a single stream.
Not a very good example that last one as it could be done as a merge...
Let's create a separate ticket and I'll investigate more useful use cases or drop it if we find it not that worth it :)
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.
Moved here: #240