Thinking Reactive
RxJs, Streams & the Ford Assembly Line
Published in
5 min readFeb 3, 2021
Understanding the big picture
The sequence
- 🏬 The salesman requests N cars to the assembly line.
- 📞 The assembly line makes a request to the store of N packages of car pieces.
- 📦 The store starts packaging a set of car parts.
- 🚚 The store delivers the package to the assembly line.
- 🏭 The assembly line starts building a car.
- 🏬🚗 The new car is sent to the concessionaire.
Timeline of events
Packaging, delivering, and building are processes that require time.
Instead of waiting for all the cars to be ready, the assembly line decides to create a contract of continuous delivery, with the concessionaire and the store.
Whenever a set of parts arrives, the assembly line will start building a car. When the new car is ready, it will be delivered to the concessionaire.
This is a simple representation of what is called a stream. A source of…