RxJava basically extends the observer pattern to support iteration on the sequence of event/data and allows the forming of sequences at the same time as abstracting away the low-level details, like threading, synchronization, concurrency, and thread safety.
At the time of writing, the current version of RxJava-2.6 has a single dependency on Reactive Streams API and provides support for Java 6 and the later versions, along with Android 2.3+. Before going deep into RxJava, let's look at the basic building blocks of ReactiveX as follows:
Observable: It is basically a data stream or in other words a source of data. It can emit the data just one time or periodically in a continuous manner, based on the configuration. Observable can send out specific data on particular events based on the operators used with Observable. In short, Observable is the supplier of data to other components.
Observer: The data stream emitted by Observable is consumed by Observers. For that, they need to subscribe to Observable using the subscribeOn() method. One ore more observers can be subscribed to Observable. When Observable sends the data, all registered observers receive the data with the onNext() callback method. Once the data is received, you can perform any operation on that. In case any error occurred during the transmission, observers will get the error data with the onError() callback.
Scheduler: They are used for thread management to achieve asynchronous programming in ReactiveX. They will instruct Observable and Observer to choose particular thread on which they can execute the operations. For that, Scheduler provide the observerOn() and scheduleOn() methods for the Observer and Observable respectively.