Skip to content

Commit dd40e79

Browse files
committed
add more detail to groupBy javadoc
1 parent 8d3a0c5 commit dd40e79

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main/java/rx/Observable.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5577,14 +5577,16 @@ public final void forEach(final Action1<? super T> onNext, final Action1<Throwab
55775577

55785578
/**
55795579
* Groups the items emitted by an {@code Observable} according to a specified criterion, and emits these
5580-
* grouped items as {@link GroupedObservable}s, one {@code GroupedObservable} per group.
5580+
* grouped items as {@link GroupedObservable}s. If a {@code GroupedObservable}
5581+
* terminates before the source terminates then the next emission by the source with the same key as the
5582+
* {@code GroupedObservable} will cause a new {@code GroupedObservable} to be emitted.
55815583
* <p>
55825584
* <img width="640" height="360" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/groupBy.png" alt="">
55835585
* <p>
55845586
* <em>Note:</em> A {@link GroupedObservable} will cache the items it is to emit until such time as it
55855587
* is subscribed to. For this reason, in order to avoid memory leaks, you should not simply ignore those
55865588
* {@code GroupedObservable}s that do not concern you. Instead, you can signal to them that they may
5587-
* discard their buffers by applying an operator like {@link #take}{@code (0)} to them.
5589+
* discard their buffers by applying an operator like {@link #ignoreElements} to them.
55885590
* <dl>
55895591
* <dt><b>Scheduler:</b></dt>
55905592
* <dd>{@code groupBy} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -5609,14 +5611,16 @@ public final <K, R> Observable<GroupedObservable<K, R>> groupBy(final Func1<? su
56095611

56105612
/**
56115613
* Groups the items emitted by an {@code Observable} according to a specified criterion, and emits these
5612-
* grouped items as {@link GroupedObservable}s, one {@code GroupedObservable} per group.
5614+
* grouped items as {@link GroupedObservable}s. If a {@code GroupedObservable}
5615+
* terminates before the source terminates then the next emission by the source with the same key as the
5616+
* {@code GroupedObservable} will cause a new {@code GroupedObservable} to be emitted.
56135617
* <p>
56145618
* <img width="640" height="360" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/groupBy.png" alt="">
56155619
* <p>
56165620
* <em>Note:</em> A {@link GroupedObservable} will cache the items it is to emit until such time as it
56175621
* is subscribed to. For this reason, in order to avoid memory leaks, you should not simply ignore those
56185622
* {@code GroupedObservable}s that do not concern you. Instead, you can signal to them that they may
5619-
* discard their buffers by applying an operator like {@link #take}{@code (0)} to them.
5623+
* discard their buffers by applying an operator like {@link #ignoreElements} to them.
56205624
* <dl>
56215625
* <dt><b>Scheduler:</b></dt>
56225626
* <dd>{@code groupBy} does not operate by default on a particular {@link Scheduler}.</dd>

0 commit comments

Comments
 (0)