Closed karlkar closed 6 years ago
The library is a wrapper itself of Reactive, it doesnt affect to the use of the schedulers.
RxJava use by default the thread from where you do the call. I haven't work with the new Architecture patterns and LiveData objets, but in your case I think that in onActive
the call is being made in a different Thread. Thats why your log is not shown from IO.
RxJava move your thread to IO in specific cases where it should do extra work with your data(such as a debounce
, an interval flowable
, a reduce
call....). But in this case, the thread will be by default the same from where you declare it.
You can read more about it in this article : https://blog.gojekengineering.com/multi-threading-like-a-boss-in-android-with-rxjava-2-b8b7cf6eb5e2
Happy coding!
Hi. I'm trying to use RxFirebaseDatabase with LiveData, so I made a following code:
As far as I understand Rx the log message should come from Io thread. However what I see in logcat is:
Did I misunderstand something? To fix this I have to do: