Skip to content

Commit 486ffe3

Browse files
committed
3.5 Mentioned throttleWithTimeout
1 parent 61d8ca0 commit 486ffe3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Part 3 - Taming the sequence/5. Time-shifted sequences.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ In this operator, a time window starts every time a value is received. Once the
416416

417417
![](https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/debounce.s.png)
418418

419-
Demonstrating this is a bit more complicated, since an `interval` observable will either have all of its values accepted or only its last (which is never if the observable is infinite). For that reason we will construct a more complicated observable.
419+
Demonstrating this is a bit more complicated, since an `interval` observable will either have all of its values accepted or only its last value accepted (which is never if the observable is infinite). For that reason we will construct a more complicated observable.
420420

421421
```java
422422
Observable.concat(
@@ -466,6 +466,8 @@ Output
466466

467467
We debounced with a window of 150ms. The bursts of emissions in our observable were faster than that (100ms), so only the last value in each burst passed through. During the slower part of our observable, all the values were accepted, because the 150ms window expired before the next value arrived.
468468

469+
There is a `throttleWithTimeout` operator which has the same behaviour as the `debounce` operator that we just saw. One is practically an alias of the other, even though neither is officially declared as such in the documentation.
470+
469471
You can also debounce based on a per item basis. In this case, you provide a function that calculates for each item how long the window should be after it. You signal that the window is over though an observable. When the observable terminates, the window expires.
470472

471473
![](https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/debounce.f.png)

0 commit comments

Comments
 (0)