Parallel Computing
Explore parallel computing techniques in Java by using RxJava's Flowable and schedulers. Learn to run calculations in parallel with flatMap, handle errors with doOnError, and verify results using JUnit tests. This lesson helps you effectively apply reactive programming for parallel task execution.
We'll cover the following...
We'll cover the following...
Parallel computing in Java
If we tie a Flowable to one Scheduler as in the previous lesson, it will run in succession, but not in parallel. To run each calculation in parallel, we could use flatMap to break out each calculation into a separate Flowable as follows: