February 2020
Intermediate to advanced
412 pages
9h 36m
English
We already saw the computation Scheduler that is created by the factory Schedulers.computation() method. Such a Scheduler maintains a fixed number of threads based on processor availability for your Java session, making it appropriate for computational tasks. Computational tasks (such as math, algorithms, and complex logic) may utilize cores to their fullest extent. Therefore, there is no benefit in having more worker threads than available cores to perform such work, and the computational Scheduler ensures that. The following is an example of a computational Scheduler usage:
Observable.just("Alpha", "Beta", "Gamma", "Delta", "Epsilon") .subscribeOn(Schedulers.computation());
When you are unsure how many tasks will be executed ...
Read now
Unlock full access