February 2020
Intermediate to advanced
412 pages
9h 36m
English
A Scheduler created by Schedulers.trampoline() is an interesting one. Most probably, you will not use it often as it is used primarily in RxJava's internal implementation. Its pattern is also borrowed for UI schedulers such as RxJavaFX and RxAndroid. It is just like default scheduling on the immediate thread, but it prevents cases of recursive scheduling where a task schedules a task while on the same thread. Instead of causing a stack overflow error, it allows the current task to finish first and to execute that new scheduled task only afterward.
Read now
Unlock full access