February 2020
Intermediate to advanced
412 pages
9h 36m
English
As we have mentioned already, the window() operator is similar to buffer(), so it should not come as a surprise that it is possible to use another Observable as a boundary value in the window() operator.
For example, we can use an Observable.interval() emitting every 1 second to serve as the boundary on an Observable emitting every 300 milliseconds. We leverage each emitted Observable to concatenate emissions into strings as follows:
import io.reactivex.rxjava3.core.Observable;import java.util.concurrent.TimeUnit;public class Ch7_11 { public static void main(String[] args) { Observable<Long> cutOffs = Observable.interval(1, TimeUnit.SECONDS); Observable.interval(300, TimeUnit.MILLISECONDS) .map(i -> (i + 1) * 300 ...
Read now
Unlock full access