February 2020
Intermediate to advanced
412 pages
9h 36m
English
Our preceding Subject example emitting Alpha, Beta, and Gamma is probably counterintuitive and backward, considering how we have architected our reactive applications. We did not define the source emissions until the end—after all the observers were set up. With such a layout, the process no longer reads from left to right, and from top to bottom.
Since Subject is hot, executing the onNext() calls before an Observer is set up would result in these emissions being missed with our Subject. For example, if you move the onNext() calls as shown in the following example, you will not get any output because the Observer will miss these emissions:
import io.reactivex.rxjava3.subjects.PublishSubject;import io.reactivex.rxjava3.subjects.Subject; ...Read now
Unlock full access