June 2017
Intermediate to advanced
400 pages
8h 44m
English
A helpful form of hot Observable is ConnectableObservable. It will take any Observable, even if it is cold, and make it hot so that all emissions are played to all Observers at once. To do this conversion, you simply need to call publish() on any Observable, and it will yield a ConnectableObservable. But subscribing will not start the emissions yet. You need to call its connect() method to start firing the emissions. This allows you to set up all your Observers beforehand. Take a look at the following code snippet:
import io.reactivex.Observable; import io.reactivex.observables.ConnectableObservable; public class Launcher { public static void main(String[] args) { ConnectableObservable<String> source = Observable
Read now
Unlock full access