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

2.x: Add finite requirement to various collector operators JavaDoc #5856

Merged
merged 2 commits into from
Feb 19, 2018

Conversation

akarnokd
Copy link
Member

Add notes to the following operators to state their sources has to be finite. It has been already done to toList in #5465.

  • collect
  • collectInto
  • reduce
  • reduceWith
  • toMap
  • toMultimap
  • toSortedList

@akarnokd akarnokd added this to the 2.2 milestone Feb 17, 2018
@codecov
Copy link

codecov bot commented Feb 17, 2018

Codecov Report

Merging #5856 into 2.x will increase coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##               2.x    #5856      +/-   ##
===========================================
+ Coverage     96.4%   96.49%   +0.08%     
- Complexity    5834     5838       +4     
===========================================
  Files          640      640              
  Lines        41944    41944              
  Branches      5804     5804              
===========================================
+ Hits         40438    40474      +36     
+ Misses         582      570      -12     
+ Partials       924      900      -24
Impacted Files Coverage Δ Complexity Δ
src/main/java/io/reactivex/Observable.java 100% <ø> (ø) 512 <0> (ø) ⬇️
src/main/java/io/reactivex/Flowable.java 100% <ø> (ø) 529 <0> (ø) ⬇️
...in/java/io/reactivex/subjects/BehaviorSubject.java 86.24% <0%> (-5.83%) 54% <0%> (ø)
...activex/internal/observers/QueueDrainObserver.java 61.53% <0%> (-2.57%) 12% <0%> (-1%)
.../internal/disposables/ListCompositeDisposable.java 98% <0%> (-2%) 34% <0%> (-1%)
...internal/operators/completable/CompletableAmb.java 98.3% <0%> (-1.7%) 11% <0%> (ø)
...ternal/operators/flowable/FlowableSubscribeOn.java 96.61% <0%> (-1.7%) 2% <0%> (ø)
...vex/internal/subscribers/QueueDrainSubscriber.java 50% <0%> (-1.57%) 15% <0%> (-1%)
...rnal/operators/flowable/FlowableFlatMapSingle.java 95.65% <0%> (-0.55%) 2% <0%> (ø)
...vex/internal/operators/parallel/ParallelRunOn.java 96.61% <0%> (-0.49%) 8% <0%> (ø)
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12c0e30...9f3fac0. Read the comment docs.

@akarnokd akarnokd changed the title 2.x: Add finite requirement to various collector operators 2.x: Add finite requirement to various collector operators JavaDoc Feb 17, 2018
* <p>
* Note that this operator requires the upstream to signal {@code onComplete} for the accumulator to
* be emitted. Sources that are infinite and never complete will never emit anything through this
* operator and an infinite source may lead to a fatal {@code OutOfMemoryError}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice addition!

Copy link
Collaborator

@davidmoten davidmoten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar nit

* a Single that emits this structure.
* <p>
* <img width="640" height="330" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/collect.png" alt="">
* <p>
* This is a simplified version of {@code reduce} that does not need to return the state on each pass.
* <p>
* Note that this operator requires the upstream to signal {@code onComplete} for the accumulator to
* be emitted. Sources that are infinite and never complete will never emit anything through this
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"accumulator to emit" or "accumulation to be emitted" or "accumulated object to be emitted". There are other occurrences of this in the PR.

@akarnokd akarnokd merged commit 0f73283 into ReactiveX:2.x Feb 19, 2018
@akarnokd akarnokd deleted the CollectorsFiniteJavadoc branch February 19, 2018 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants