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: Update Mathematical and Aggregate Operators docs #6140

Merged

Conversation

lorenzpahl
Copy link
Contributor

This PR updates the Mathematical-and-Aggregate-Operators.md wiki page as per issue #6132:

The page now follows the structure that was defined in #6131.

Question: Should Available in in the Mathematical Operators section be renamed to something else (e.g. Defined for), because the operators are not part of the core RxJava operators?

@codecov
Copy link

codecov bot commented Aug 5, 2018

Codecov Report

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

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6140      +/-   ##
============================================
+ Coverage     98.19%   98.27%   +0.08%     
  Complexity     6195     6195              
============================================
  Files           667      667              
  Lines         44853    44853              
  Branches       6213     6213              
============================================
+ Hits          44043    44081      +38     
+ Misses          259      235      -24     
+ Partials        551      537      -14
Impacted Files Coverage Δ Complexity Δ
...activex/internal/observers/QueueDrainObserver.java 97.43% <0%> (-2.57%) 21% <0%> (-1%)
...activex/internal/schedulers/ExecutorScheduler.java 97.97% <0%> (-2.03%) 9% <0%> (ø)
...ternal/operators/flowable/FlowableSubscribeOn.java 96.61% <0%> (-1.7%) 2% <0%> (ø)
...internal/operators/flowable/FlowableSwitchMap.java 95.28% <0%> (-1.42%) 3% <0%> (ø)
...x/internal/operators/flowable/FlowableGroupBy.java 94.67% <0%> (-0.85%) 3% <0%> (ø)
.../operators/observable/ObservableFlatMapSingle.java 88.8% <0%> (-0.75%) 2% <0%> (ø)
...vex/internal/operators/flowable/FlowableCache.java 97.94% <0%> (-0.69%) 10% <0%> (-1%)
...ain/java/io/reactivex/subjects/UnicastSubject.java 99.36% <0%> (-0.64%) 64% <0%> (-1%)
...ivex/internal/operators/parallel/ParallelJoin.java 94.48% <0%> (-0.37%) 3% <0%> (ø)
...ternal/operators/flowable/FlowableWindowTimed.java 91.17% <0%> (-0.23%) 4% <0%> (ø)
... and 21 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 bb93911...c38b4ab. Read the comment docs.

Copy link
Member

@akarnokd akarnokd left a comment

Choose a reason for hiding this comment

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

Great work, but some small adjustments would be great. See comments below.

This page shows operators that perform mathematical or other operations over an entire sequence of items emitted by an `Observable`. Because these operations must wait for the source `Observable` to complete emitting items before they can construct their own emissions (and must usually buffer these items), these operators are dangerous to use on `Observable`s that may have very long or infinite sequences.
Copy link
Member

Choose a reason for hiding this comment

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

"or Flowable"


> The operators in this section are part of the [`RxJava2Extensions`](https://github.com/akarnokd/RxJava2Extensions) project. You have to add the `rxjava2-extensions` module as a dependency to your project. It can be found at [http://search.maven.org](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.github.akarnokd%22).

Copy link
Member

Choose a reason for hiding this comment

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

For clarity, you could include the import here:

import hu.akarnokd.rxjava2.math.MathObservable`;
import hu.akarnokd.rxjava2.math.MathFlowable`;

Copy link
Member

Choose a reason for hiding this comment

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

Also you can add the following additional note.

"Note that unlike the standard RxJava aggregator operators, these mathematical operators return Observable and Flowable instead of the Single or Maybe."

```

## Other Aggregate Operators
Copy link
Member

Choose a reason for hiding this comment

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

"Standard Aggregate Operators"


## Other Aggregate Operators

Copy link
Member

Choose a reason for hiding this comment

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

A note on the return type would be great here:

"Note that these standard aggregate operators return a Single or Maybe because the number of output items is always know to be at most one."

```

### toList and toSortedList
Copy link
Member

Choose a reason for hiding this comment

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

Please split these into their own section.

```

### collect and collectInto
Copy link
Member

Choose a reason for hiding this comment

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

Please split these into their own section.

```

### reduce and reduceWith
Copy link
Member

Choose a reason for hiding this comment

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

Please split these into their own section.

@akarnokd akarnokd added this to the 3.0 milestone Aug 5, 2018
@akarnokd akarnokd merged commit c8b0a0e into ReactiveX:2.x Aug 5, 2018
@lorenzpahl lorenzpahl deleted the docs/mathematical-and-aggregate-operators branch August 6, 2018 17:28
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.

2 participants