Hands-On Reactive Programming in Spring 5
上QQ阅读APP看书,第一时间看更新

Reactive types of RxJava 2

Even though the RxJava 2.x library and Project Reactor have the same basis, RxJava 2 has a different set of reactive publishers. As these two libraries implement the same ideas, it is worth describing how RxJava 2 differs, at least regarding reactive types. All other aspects, including reactive operators, thread management, and error handling, are pretty similar. So, being more or less familiar with one of the libraries means being familiar with both of them.

As described in Chapter 2Reactive Programming in Spring - Basic Concepts, RxJava 1.x originally had only one reactive type: Observable. Later, the Single and Completable types were added. In version 2, the library has the following reactive types—ObservableFlowableSingleMaybe, and Completable.  Let's briefly describe the difference between these and compare them to the Flux/Mono tandem.