-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat: add stream method for ServerStream
#1575
Conversation
LGTM |
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.
Let's merge this at the same time as the Page's
@@ -89,6 +91,10 @@ public Iterator<V> iterator() { | |||
return iterator; | |||
} | |||
|
|||
public Stream<V> stream() { |
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.
Can you please add Javadoc? All public methods are required to have Javadoc.
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.
done
@@ -89,6 +91,10 @@ public Iterator<V> iterator() { | |||
return iterator; | |||
} | |||
|
|||
public Stream<V> stream() { | |||
return StreamSupport.stream(this.spliterator(), false); |
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 see that the second argument is set to false, which means this is a sequential stream, do we want to expose another parallelStream
method as well?
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'm not sure whether a deterministic result is required as parallel stream can randomize the result.
Also, we could explore more about parallel stream later as we did in Page
.
[gapic-generator-java-root] Kudos, SonarCloud Quality Gate passed! |
[java_showcase_integration_tests] Kudos, SonarCloud Quality Gate passed! |
[java_showcase_unit_tests] Kudos, SonarCloud Quality Gate passed! |
…1575) (#914) Source-Link: googleapis/synthtool@2e9ac19 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93
…1575) (#795) Source-Link: googleapis/synthtool@2e9ac19 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93
Fixes #1576 ☕️