RXScala has three major building blocks or components to perform asynchronous stream programming—Observable, Subscription, and Observer:
![](https://static.packt-cdn.com/products/9781787288645/graphics/assets/e372acfb-978a-4375-ac8a-c9eb359eb71e.png)
Here, we can observe the following things:
- Observable works as a producer; that means it emits the data
- Observer works as a consumer; that means it consumes the data
- Subscription works as a channel between Observable and Observer to emit and consume data through this channel
The following diagram shows the relationship between RxScala components and how they work with each other:
![](https://static.packt-cdn.com/products/9781787288645/graphics/assets/6cd43e55-7371-4c75-ba96-b6c21b9c90f8.png)
There are two more components to perform the asynchronous data stream processing:
- Subscriber
- Scheduler