June 2017
Intermediate to advanced
400 pages
8h 44m
English
More likely, you will use Subjects to eagerly subscribe to an unknown number of multiple source Observables and consolidate their emissions as a single Observable. Since Subjects are an Observer, you can pass them to a subscribe() method easily. This can be helpful in modularized code bases where decoupling between Observables and Observers takes place and executing Observable.merge() is not that easy. Here, I use Subject to merge and multicast two Observable interval sources:
import io.reactivex.Observable;import io.reactivex.subjects.PublishSubject;import io.reactivex.subjects.Subject;import java.util.concurrent.TimeUnit;public class Launcher { public static void main(String[] args) { Observable<String> source1 =
Read now
Unlock full access