February 2020
Intermediate to advanced
412 pages
9h 36m
English
One last concurrency operator that we need to cover is unsubscribeOn(). Disposing of an Observable can be an expensive (in terms of the time it takes) operation, depending on the nature of the source. For instance, if the Observable emits the results of a database query using RxJava-JDBC, (https://github.com/davidmoten/rxjava-jdbc), it can be expensive to dispose of because it needs to shut down the JDBC resources it is using. This can cause the thread that calls dispose() to become busy. If this is a UI thread in JavaFX or Android (for instance, because a CANCEL PROCESSING button was clicked), this can cause undesirable UI freezing.
Here is a simple Observable that is emitting every second. We stop the main ...
Read now
Unlock full access