Skip to content

Commit 2a3ade2

Browse files
Update javadoc for throttleWithTimeout
1 parent 4c0c4db commit 2a3ade2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,11 +1811,12 @@ public static Observable<Long> interval(long interval, TimeUnit unit, Scheduler
18111811
}
18121812

18131813
/**
1814-
* Throttles the {@link Observable} by dropping values which are followed by newer values before the timer has expired.
1814+
* Throttles by dropping all values that are followed by newer values before the timeout value expires. The timer reset on each `onNext` call.
1815+
* <p>
1816+
* NOTE: If the timeout is set higher than the rate of traffic then this will drop all data.
18151817
*
18161818
* @param timeout
18171819
* The time each value has to be 'the most recent' of the {@link Observable} to ensure that it's not dropped.
1818-
*
18191820
* @param unit
18201821
* The {@link TimeUnit} for the timeout.
18211822
*
@@ -1826,15 +1827,17 @@ public Observable<T> throttleWithTimeout(long timeout, TimeUnit unit) {
18261827
}
18271828

18281829
/**
1829-
* Throttles the {@link Observable} by dropping values which are followed by newer values before the timer has expired.
1830+
* Throttles by dropping all values that are followed by newer values before the timeout value expires. The timer reset on each `onNext` call.
1831+
* <p>
1832+
* NOTE: If the timeout is set higher than the rate of traffic then this will drop all data.
18301833
*
18311834
* @param timeout
18321835
* The time each value has to be 'the most recent' of the {@link Observable} to ensure that it's not dropped.
18331836
* @param unit
1834-
* The {@link TimeUnit} for the timeout.
1837+
* The unit of time for the specified timeout.
18351838
* @param scheduler
1836-
* The {@link Scheduler} to use when timing incoming values.
1837-
* @return An {@link Observable} which filters out values which are too quickly followed up with newer values.
1839+
* The {@link Scheduler} to use internally to manage the timers which handle timeout for each event.
1840+
* @return Observable which performs the throttle operation.
18381841
*/
18391842
public Observable<T> throttleWithTimeout(long timeout, TimeUnit unit, Scheduler scheduler) {
18401843
return create(OperationThrottleWithTimeout.throttleWithTimeout(this, timeout, unit, scheduler));

0 commit comments

Comments
 (0)