June 2017
Intermediate to advanced
400 pages
8h 44m
English
Hopefully, you will feel that our earlier Subject example emitting Alpha, Beta, and Gamma is counterintuitive and backward considering how we have architected our reactive applications so far, and you would be right to think that way. We did not define the source emissions until the end after all the Observers are set up, and the process no longer reads left-to-right, top-to-bottom. Since Subjects are hot, executing the onNext() calls before the Observers are set up would result in these emissions being missed with our Subject. If you move the onNext() calls like this, you will not get any output because the Observer will miss these emissions:
import io.reactivex.subjects.PublishSubject;import io.reactivex.subjects. ...
Read now
Unlock full access