Skip to content

Introduce Stream.consumeAsFlow #1605

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

Merged
merged 1 commit into from
Oct 17, 2019
Merged

Introduce Stream.consumeAsFlow #1605

merged 1 commit into from
Oct 17, 2019

Conversation

qwwdfsad
Copy link
Collaborator

@qwwdfsad qwwdfsad commented Oct 9, 2019

* Even though java.lang.Stream is collected rather than consumed, collectAsFlow will clash with Flow terminology where collect is a terminal operator
* Close the stream in the end of collection despite the fact that regular terminal operations don't do that. We are already in suspending world (empty close() call won't make any difference in a common case) and "consume" implies closing the underlying resource (note that we already do it for channels)
* Remove obsolete examples from the module

Fixes #1601

    * Even though java.lang.Stream is collected rather than consumed, collectAsFlow will clash with Flow terminology where collect is a terminal operator
    * Close the stream in the end of collection despite the fact that regular terminal operations don't do that. We are already in suspending world (empty close() call won't make any difference in a common case) and "consume" implies closing the underlying resource (note that we already do it for channels)
    * Remove obsolete examples from the module

Fixes #1601
@qwwdfsad qwwdfsad requested a review from elizarov October 9, 2019 16:11
@elizarov
Copy link
Contributor

LGTM.

@qwwdfsad qwwdfsad marked this pull request as ready for review October 17, 2019 09:10
@qwwdfsad qwwdfsad merged commit ef27ac3 into develop Oct 17, 2019
@qwwdfsad qwwdfsad deleted the stream-flow branch October 17, 2019 09:10
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

Successfully merging this pull request may close these issues.

2 participants