Concurrency in RxJava is simple to execute, but somewhat abstract to understand. By default, an Observable executes on the immediate thread, which is the thread that declared the Observer and subscribed it. In many of our earlier examples, this was the main thread that kicked off our main() method.
However, as hinted in a few other examples, not every Observable fires on the immediate thread. Remember those times we used Observable.interval(), as shown in the following code? Let's take a look:
import io.reactivex.rxjava3.core.Observable;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.TimeUnit;
public class Ch6_01 {
public static void main(String[] args) {
DateTimeFormatter f = DateTimeFormatter.ofPattern("MM:ss");
System.out.println(LocalDateTime.now().format(f))...