From docs :
By default, the Observable and the chain of operators that you access will do its job and will notify its observers on the same topic on which the Subscribe method is called. The SubscribeOn statement modifies this behavior by specifying a different scheduler on which the Observable should run . The ObserveOn statement indicates another scheduler that the Observable will use to send notifications to its observers.
So you can just use subscribe instead of subscribeOn to watch your collection in the same thread that was created, something like this:
Observable.create(new rx.Observable.OnSubscribe<String>() { @Override public void call(Subscriber<? super String> subcriber) { System.out.println("2: " + Thread.currentThread().getId());
UPDATE: If your application is an Android application, you can use the subscription on the background thread as you do, and transfer the results to the main thread using Handler messages.
If your application is a Java application, I can suggest using the wait () and notify () mechanism or consider using frameworks like EventBus or akka for more complex scenarios.
source share