Skip to content

Commit 526d091

Browse files
committed
(#1045) clarify javadocs to accurately describe currently-intended behavior of sample()
1 parent 81e0f7a commit 526d091

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

rxjava-core/src/main/java/rx/Observable.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6058,8 +6058,8 @@ public final Observable<T> retry(int retryCount) {
60586058
}
60596059

60606060
/**
6061-
* Returns an Observable that emits the results of sampling the items emitted by the source Observable at a
6062-
* specified time interval.
6061+
* Returns an Observable that emits the most recently emitted item (if any) emitted by the source Observable
6062+
* within periodic time intervals.
60636063
* <p>
60646064
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/sample.png">
60656065
*
@@ -6076,8 +6076,8 @@ public final Observable<T> sample(long period, TimeUnit unit) {
60766076
}
60776077

60786078
/**
6079-
* Returns an Observable that emits the results of sampling the items emitted by the source Observable at a
6080-
* specified time interval.
6079+
* Returns an Observable that emits the most recently emitted item (if any) emitted by the source Observable
6080+
* within periodic time intervals, where the intervals are defined on a particular Scheduler.
60816081
* <p>
60826082
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/sample.s.png">
60836083
*
@@ -6096,8 +6096,9 @@ public final Observable<T> sample(long period, TimeUnit unit, Scheduler schedule
60966096
}
60976097

60986098
/**
6099-
* Return an Observable that emits the results of sampling the items emitted by the source Observable
6100-
* whenever the specified {@code sampler} Observable emits an item or completes.
6099+
* Returns an Observable that, when the specified {@code sampler} Observable emits an item or completes,
6100+
* emits the most recently emitted item (if any) emitted by the source Observable since the previous
6101+
* emission from the {@code sampler} Observable.
61016102
* <p>
61026103
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/sample.o.png">
61036104
*

0 commit comments

Comments
 (0)