Skip to content

Commit 882fcde

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

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/rx/Observable.java

Lines changed: 7 additions & 3 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, one {@code GroupedObservable} per group. 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 the {@code GroupedObservable} to be resubscribed to.
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,7 +5611,9 @@ 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, one {@code GroupedObservable} per group. 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 the {@code GroupedObservable} to be resubscribed to.
56135617
* <p>
56145618
* <img width="640" height="360" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/groupBy.png" alt="">
56155619
* <p>

0 commit comments

Comments
 (0)